안녕하세요 포인트 랭킹 css 질문이요
본문
이미지 보시면 순위 이름 포인트 나오는데
그위에다가 순위 회원이름 포인트 라고 1위 위에다가 좀 쓰고싶은데 어떻게 해야 될까요?ㅠㅠ
point_rank10.php css소스 입니다.ㅠㅠ 좀도와주시면 감사하겠습니다.
<?php
include_once("./_common.php");
?>
<style type="text/css">
:root {--v-pl_rank-width: 210px;}
.pl_rank{clear:both;position:relative;margin:0 auto;width:var(--v-pl_rank-width);padding:5px 0 5}
.pl_rank2:after {display:block;visibility:hidden;clear:both;content:""}
.pl_rank h2{padding:0;line-height:20px;color:#6B8864;text-align: center}
.pl_rank h3{padding:0;line-height:25px;color:#cccccc;text-align: center}
.pl_rank h4{border:0.075px solid;width:180px;margin-left: auto;margin-right: auto;color:#636465}
.pl_rank_ul{padding:0px 0 0}
.pl_rank_ul ul li .rank_name{margin-left:35px}
.pl_rank_ul ul{float:left;width:var(--v-pl_rank-width);margin:0;padding:0;overflow:hidden;list-style:none;color:#968d66}
.pl_rank_ul ul li{position:relative;line-height:18px;margin:5px 0 0 15px;margin-left:15px}
.pl_rank_ul ul li .rank_bg{display:inline-block;width:17px;height:17px;margin-right:8px;border:1px solid #b3b8c0;text-align:center;color:#b3b8c0;text-indent:-1px}
.pl_rank_ul ul li .rank_bg1{border:1px solid #ed2525;color:#ed2525}
.pl_rank_ul ul li .rank_bg2{border:1px solid #3452be;color:#3452be}
.pl_rank_ul ul li .rank_bg3{border:1px solid #D6C00A;color:#D6C00A}
.pl_rank_ul ul li .rank_point{display:inline-block;position:absolute;top:0;right:20px;font-family:verdana;color:#d83d44;font-size:10px;font-weight:bold;text-align: center}
</style>
<div class="pl_rank">
<h2>※ 회원 전체 포인트 순위 ※</h2>
<h3>포인트 랭킹은 30위 까지 표기됨</h3>
<h4></h4>
<div class="pl_rank_ul">
<ul>
<?php
$sql_common = " and mb_id != '{$config[cf_admin]}' ";
$rank_rows = 30; //출력 수
$sql = " select * from {$g5[member_table]} where mb_point > '{$row[mb_point]}' {$sql_common} order by mb_point desc, mb_today_login desc limit {$rank_rows} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$rank = number_format($i + 1);
//$rank_name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$rank_name = $row['mb_nick'];
$point = number_format($row['mb_point']);
if ($rank == 1) {
$rank_bg = ' rank_bg1';
} else if ($rank <= 10) {
$rank_bg = ' rank_bg2';
} else if ($rank <= 30) {
$rank_bg = ' rank_bg3';
} else {
$rank_bg = '';
}
?>
<li>
<span class="rank_bg<?php echo $rank_bg; ?>"><?php echo $rank; ?></span>
<span class="rank_name"><?php echo $rank_name; ?></span>
<span class="rank_point"><?php echo $point; ?></span>
</li>
<?php } ?>
</ul>
</div>
</div>
!-->
답변 3
css에서 조절하세요. class를 넣고요.
ex) <span class="rank_bg0">순위</span>
.pl_rank_ul ul li .rank_bg0{width:25px;}추가, 등등..
<?php
include_once("./_common.php");
?>
<style type="text/css">
:root {--v-pl_rank-width: 210px;}
.pl_rank{clear:both;position:relative;margin:0 auto;width:var(--v-pl_rank-width);padding:5px 0 5}
.pl_rank2:after {display:block;visibility:hidden;clear:both;content:""}
.pl_rank h2{padding:0;line-height:20px;color:#6B8864;text-align: center}
.pl_rank h3{padding:0;line-height:25px;color:#cccccc;text-align: center}
.pl_rank h4{border:0.075px solid;width:180px;margin-left: auto;margin-right: auto;color:#636465}
.pl_rank_ul{padding:0px 0 0}
.pl_rank_ul ul li .rank_name{margin-left:35px}
.pl_rank_ul ul{float:left;width:var(--v-pl_rank-width);margin:0;padding:0;overflow:hidden;list-style:none;color:#968d66}
.pl_rank_ul ul li{position:relative;line-height:18px;margin:5px 0 0 15px;margin-left:15px}
.pl_rank_ul ul li .rank_bg{display:inline-block;width:17px;height:17px;margin-right:8px;border:1px solid #b3b8c0;text-align:center;color:#b3b8c0;text-indent:-1px}
.pl_rank_ul ul li .rank_bg1{border:1px solid #ed2525;color:#ed2525}
.pl_rank_ul ul li .rank_bg2{border:1px solid #3452be;color:#3452be}
.pl_rank_ul ul li .rank_bg3{border:1px solid #D6C00A;color:#D6C00A}
.pl_rank_ul ul li .rank_point{display:inline-block;position:absolute;top:0;right:20px;font-family:verdana;color:#d83d44;font-size:10px;font-weight:bold;text-align: center}
</style>
<div class="pl_rank">
<h2>※ 회원 전체 포인트 순위 ※</h2>
<h3>포인트 랭킹은 30위 까지 표기됨</h3>
<h4></h4>
<div class="pl_rank_ul">
<ul>
<li>
<span>순위</span>
<span class="rank_name">이름</span>
<span class="rank_point">포인트</span>
</li>
</ul>
<ul>
<?php
$sql_common = " and mb_id != '{$config[cf_admin]}' ";
$rank_rows = 30; //출력 수
$sql = " select * from {$g5[member_table]} where mb_point > '{$row[mb_point]}' {$sql_common} order by mb_point desc, mb_today_login desc limit {$rank_rows} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$rank = number_format($i + 1);
//$rank_name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$rank_name = $row['mb_nick'];
$point = number_format($row['mb_point']);
if ($rank == 1) {
$rank_bg = ' rank_bg1';
} else if ($rank <= 10) {
$rank_bg = ' rank_bg2';
} else if ($rank <= 30) {
$rank_bg = ' rank_bg3';
} else {
$rank_bg = '';
}
?>
<li>
<span class="rank_bg<?php echo $rank_bg; ?>"><?php echo $rank; ?></span>
<span class="rank_name"><?php echo $rank_name; ?></span>
<span class="rank_point"><?php echo $point; ?></span>
</li>
<?php } ?>
</ul>
</div>
</div>
답변을 작성하시기 전에 로그인 해주세요.