div+css IE 6,7,8兼容的一个实例_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:29:16
Original
856 people have browsed it

===========解决ie6 与ie8的padding问题==========
一开始我一直以为ie6加了padding显示的width=width+pading 其实不是,找了资料 ie下都不会的
如果这样你就要检查的css设置
看我的:
前台代码:


  • /content/.do">·


  • 原css代码
    .ul_con li { line-height:170%; float:left; width:100%;_width:100%; text-align:left; font-size:13px; border-bottom:solid 1px #ececec; background-image: url('/village/content/icon/title.gif');background-repeat: no-repeat;background-position:left center; padding-left:10px;float:left; POSITION: relative;}

    ie7,8下没问题,ie6下 ul表的总宽度增长了10px,界面难看死了。开始以ie6下会加上他的pading值。找了资料都说不会加的,只有firefox下才会加的。
    冥思苦想后,原来我这个在ie6下 显示的宽度是 li的padding+a的width=10+100%难怪会增加。现在我把padding写在a里面 问题解决
    代码如下:
    .ul_con li { line-height:170%; float:left; width:100%;_width:100%; text-align:left; font-size:13px; border-bottom:solid 1px #ececec; }
    .ul_con li a{background-image: url('/village/content/icon/title.gif');background-repeat: no-repeat;background-position:left center; padding-left:10px;float:left; POSITION: relative;}

    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!