How to call <li class=“#”> in CSS? > HTML,CSS,레이아웃

본문 바로가기

사이트 내 전체검색

  • PC

  • HTML,CSS,레이아웃

    How to call <li class=“#”> in CSS?

    페이지 정보

    작성자 로빈아빠 작성일15-01-27 09:05 조회5,850회 댓글0건

    본문

    <li class="my-class">...</li>

     

    #nav li {border-right:1px solid #f00}

    and then you have class="no-border" on the last <li> in the list, then you'll need this to remove the border:

     

    #nav li.no-border {border-right:none}

    div ul li.no-border a { }

     

     

     

     

    ex)

     

     

    <?php

    $sql = " select *

    from {$g5['menu_table']}

    where me_mobile_use = '1'

     and length(me_code) = '2'

    order by me_order ";

    $result = sql_query($sql, false);

    $arr_menu_top=array();

    $arr_menu_sub=array();

     

    for($i=0; $row=sql_fetch_array($result); $i++) {

    $arr_menu_top[]=$row;

    $sql2 = " select *

    from {$g5['menu_table']}

    where me_mobile_use = '1'

     and length(me_code) > '2'

     and substring(me_code, 1, 2) = '{$row['me_code']}'

    order by me_order ";

    $result2 = sql_query($sql2);

    //echo $sql2;

     

       for ($k=0; $row2=sql_fetch_array($result2); $k++) {

    $arr_menu_sub[ $row[me_code] ][]=$row2;

    }

     

    }

     

    ?>

     

     

     

     

    <style>

    ul,ol {list-style:none;}

    img {border:none;}

     

     

    #navi {position:relative; width:100%; height:91px;}

    #navi li {float:left; width:33%; background:#60ba2f; text-align:center; padding:15px 0; font-size:10pt; font-family:NanumGothic,'나눔고딕',ng,sans-serif; color:#fff; font-weight:bold; border-right:solid 1px #fff; border-bottom:solid 1px #fff;}

    #navi li a {color:#fff;}

     

    #sub_navi {position:relative; width:100%; height:auto; margin-top:30px;}

    #sub_navi li {width:100%; background:#8ebf73; text-align:left; padding:10px 0 10px 10px; font-size:10pt; font-family:NanumGothic,'나눔고딕',ng,sans-serif; color:#fff; font-weight:bold; border-right:solid 1px #578a3c; border-bottom:solid 1px #578a3c;}

    #sub_navi li a {color:#fff; text-decoration:none;}

     

    #sub_navi li.sub2depth {padding-left:20px;font-weight:normal;}

    </style>

     

     

     

     

    <div id="navi">

    <ul>

    <?

     

    //현재위치 찾기

    $cur_me_code='';

    foreach($arr_menu_top as $row) {

    if (!$cur_me_code && ar_check_menu_url($row['me_link']))

    $cur_me_code=$row[me_code];

    if (!$cur_me_code) {

    foreach($arr_menu_top as $row) {

     

    foreach($arr_menu_sub[ $row[me_code] ] as $row2) { 

    if (ar_check_menu_url($row2['me_link'])) {

    $cur_me_code=$row[me_code];

    break;

    }

    }

    if ($cur_me_code) break;

    }

     

    foreach($arr_menu_top as $row) {

    ?>

    <li><a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>"><?=$row['me_name']?></a></li>

    <? } ?>

        </ul>

    </div>

     

     

    <? if ($arr_menu_sub[$cur_me_code]) { ?>

     

    <div id="sub_navi">

    <ul>

    <? foreach($arr_menu_sub[$cur_me_code] as $row) { ?>

    <li class='<?=($row[me_order]%100?'sub2depth':'')?>'><a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>"><?=$row['me_name']?></a></li>

    <? } ?>

        </ul>

    </div>

    <? } ?>

    추천 0

    댓글목록

    등록된 댓글이 없습니다.

    HTML,CSS,레이아웃 목록

    게시물 검색

    PC 버전으로 보기