好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

去掉inline-block元素间隙的几种方法_html/css_WEB-ITnose






super胡

#a1 {
list-style: none ;
background: green;
text-align: center;
padding:10px;
}
#a1 li {
display: inline-block;
background: orange;

}
#a2 {
list-style: none ;
background: green;
text-align: center;
padding:10px;
}
#a2 li {
display: inline-block;
background: orange;

}
#a3 {
list-style: none ;
background: green;
text-align: center;
padding:10px;
font-size:0px;/*父元素设置 font-size:0px; 子元素需要重新设置*/
}
#a3 li {
display: inline-block;
background: orange;
font-size:16px;
}
#a4 {
list-style: none ;
background: green;
text-align: center;
padding:10px;
}
#a4 li {
display: inline-block;
background: orange;

}






item1
--> item2
item3
item4
item5


item1
item2 之间没有空隙-->
item3
item4
item5



item1

item2

item3

item4

item5



item1
item2
item3
item4
item5



查看更多关于去掉inline-block元素间隙的几种方法_html/css_WEB-ITnose的详细内容...

  阅读:30次