网络编程
位置:首页>> 网络编程>> 网页设计>> css reset中的list-style:none(2)

css reset中的list-style:none(2)

作者:4321285 来源:蓝色理想 发布时间:2010-05-26 13:56:00 

标签:CSS,reset,list-style

看看在FF里这个UL到底拥有哪些属性

图上可见,当css中定义list-style:none时,对list-style-position 并没有影响,仍然是FF浏览器的默认设置,值为outside
而IE6,7中很可能默认list-style-position:inside
为了证实这一点,我把list-style:none 换为list-style:none inside none再测试了一下

运行代码框


 

运行后可以发现,在IE6,7中,与list-style:none的表现一模一样.
所以我推测在IE6,7中当UL具有float:left和display:inline属性后,设置了list-style:none,则list-style-position也默认为inside了;

所以我得出的总结是
在IE6,7下,当UL不具有float:left;display:inline;时:
无论有没有list-style:none这个属性,列表符都被隐藏,不占位置(下面代码中的5,6)
当UL具有float:left;display:inline;属性时
list-style:none,列表符被隐藏,但是仍然留有位置(list-style-position:inside);(下面代码中的 UL1,ul3)
未设置list-style:none;列表符被隐藏,也不占位(list-style-position:outside)(代码UL4)

而UL02 在参与测试的各浏览器中表现都比较理想

最后这一段代码对比一下各种情况下list-style的表现,尤其注意4,5,6在IE6,7下的表现

运行代码框

通过上面代码表现结果的对比,我认为:
在firefox中只要list-style-type为none ,则无论list-stype-position的值为outside或inside , list-style都能很好的被隐藏
而在IE6,7中,仅设置list-style:none,并不足以解决所有问题
所以我认为在css reset的时候使用 list-style:none outside none 更好

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com