WD1X.COM - 问答一下,轻松解决,电脑应用解决专家
主板显卡CPU内存显示器
硬盘维修显卡维修显示器维修
注册表系统命令DOS命令Win8
存储光存储鼠标键盘
内存维修打印机维修
WinXPWin7Win11Linux
硬件综合机箱电源散热器手机数码
主板维修CPU维修键盘鼠标维修
Word教程Excel教程PowerPointWPS
网络工具系统工具图像工具
数据库javascript服务器
PHP教程CSS教程XML教程

css解决li边框重合问题

更新时间:2021-03-24 13:07 作者:穆雄雄点击:
我直接写了个案例,先看下效果图:
li边框重合问题
下面是html代码:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>机构动态</title>
 
        <style type="text/css">
        *{
            margin:0px;
            padding:0px; 
        }
            .test_m ul {
                    margin: 20px;
                    width: 630px;
                    overflow:hidden;
                    border-top:1px solid black;
            }
            .test_m ul li{
                padding: 10px 20px 11px 20px;
                box-sizing: border-box;
                 float: left;
                 width: 315px;
                 height: 111px;
                 list-style: none;
                }
            .test_m ul li:nth-child(2n+1){
                border:1px solid black;
                border-top:0;
            }
            .test_m ul li:nth-child(2n){
                border-bottom:1px solid black;
                border-right:1px solid black;
            }
        </style>
    </head>
    <body>
        <div class="test_m">
 
            <ul>
                <li>
                    菜单1
                </li>
                <li>
                    菜单2
                </li>
                <li>
                    菜单3
                </li>
                <li>
                    菜单4
                </li>
 
            </ul>
        </div>
    </body>
</html>
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
你可能感兴趣的内容