简体   繁体   中英

Different look between Google Chrome and Firefox

I work on list this list appear images the last image in the row look like has top margin in firefox but in Google Chrom look perfect I am not good in English so this image explain what I mean :)

Image explain What I mean : http://filaty.com/i/alpha/74/74f4cb7180dd52b3d8d670bb31be8156

Html

<ul id="nwp_port_item" class="clearfix">
    <li class="mix webdesign"><img src="images/demo/e1.jpg"></li>
    <li class="mix graphics"><img src="images/demo/e2.jpg"></li>
    <li class="mix wordpress"><img src="images/demo/e3.jpg"></li>
    <li class="mix photography"><img src="images/demo/e4.jpg"></li>
    <li class="mix wordpress"><img src="images/demo/e5.jpg"></li>
    <li class="mix photography"><img src="images/demo/e6.jpg"></li>
    <li class="mix webdesign"><img src="images/demo/e1.jpg"></li>
    <li class="mix graphics"><img src="images/demo/e2.jpg"></li>
</ul>

CSS :

#nwp_port_item {
    margin:20px 0;
    padding:0;
    list-style:none;
    line-height:0;
}
#nwp_port_item li {
    display:block;
    padding:0;
    margin:1px;
    float:left;
    width:180px;
    height:200px;
    overflow:hidden;
    position:relative;
}
#nwp_port_item li img {
    width:100%;
    height:auto;
}

I use bootstrap to reset browser

Code on JSFiddle http://jsfiddle.net/4t6Ch/

It is looks like image have some vertical-align.

Try to add some styles for image:

#nwp_port_item li img {
    width:100%;
    height:auto;
    display: block;
    margin:0; 
    padding:0;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM