개발

[퍼블리싱] 마지막 li 크기만 변경하기

지승준 2015. 2. 13. 21:55
1
2
3
4
5
6
7
8
9
10
11
<style type="text/css">
    *{border:0; padding:0; margin:0;}
    li{list-style:none;}
    .wrap{background:blue; width:500px; height:1000px; margin:0 auto;}
    .list{}
    .list:after{content:""; display:block; clear:both;}
    .list li{float:left; width:92px; height:50px; background:red; margin-right:10px;}
    /* .list li:last-child{margin-right:0;} //html5에서만 가능*/
    /* .list li + li + li + li + li{margin-right:0;} */
    .mgr_x{margin-right:0 !important;}
</style>
cs


1
2
3
4
5
6
7
8
9
10
11
<body>
     <div class="wrap">
        <ul class="list">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li class="mgr_x"></li>
        </ul>
    </div>
</body>
cs