为了账号安全,请及时绑定邮箱和手机立即绑定

我是这样子写的、可以参考一下

.topList{

    width:300px;

    height:180px;

    border:1px solid #E8E8E8;

    margin:0 auto;

}

.topList ul{

    list-style-type:none;

    padding:5px;

    font-size:12px;

    margin-top:-5px;

}

em{

    width:20px;

    height:16px;

    text-align:center;

    font-style:normal;

    color:#333;

    background:url(http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg) no-repeat bottom center;

    display:block;

    float:left;

}

.top em{

    color:#FFF;

    background:url(http://img1.sycdn.imooc.com//53cf0fa20001d3dc00200032.jpg) no-repeat top center;

}

.topList a:link,.topList a:visited{

    text-decoration: none;

    color: #888;

}

.topList a:hover,.topList a:active{

    text-decoration: none;

    color: #F00;

}


正在回答

1 回答

为什么不设置margin-top:-5px;文字就偏离边框了?前面空出的几行咋产生的?

0 回复 有任何疑惑可以回复我~
#1

Konky

margin-top:-5px;可以改成margin-bottom:5px;吗,如果不可以是为什么呢
2022-05-31 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

我是这样子写的、可以参考一下

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号