css after 插入图片,怎么设置内容高度



 .nav ul li:after{content: url(../img/nav_fg.png);}

效果如此图


ps:或者用其他方法实现效果也行!

css3 after HTML html5 css

囧‖夏总‖ 9 years, 3 months ago

支持IE6不?

人不H枉少年 answered 9 years, 3 months ago

答非所问了。关注中

kikyo answered 9 years, 3 months ago

给display:block试试

华西好人集团 answered 9 years, 3 months ago

.nav ul li:after{content:" ";width: 2px;height: 45px;content: url(../img/nav_fg.png);}
after 本身不占位, 要给一个 content.

野生的路人 answered 9 years, 3 months ago

使用了另外一种方法,在li后添加一个空的li 并且写样式


 .nav ul .fg{width: 2px;height: 45px;background: url(../img/nav_fg.png);}

还是希望有大神解决直接使用after添加的方法。

soviet answered 9 years, 3 months ago


 .nav ul li:after{display: block; content:"";width: 2px;height: 45px;content: url(../img/nav_fg.png);}

桐之丶卧所 answered 9 years, 3 months ago

Your Answer