Home > Web Front-end > HTML Tutorial > It is not compatible under ie6, please help analyze the reason_html/css_WEB-ITnose

It is not compatible under ie6, please help analyze the reason_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 12:11:12
Original
1371 people have browsed it

<div class="main">    <div class="leftbar"></div>    <div class="middle"></div>    <div class="rightbar"></div> </div>
Copy after login

The general framework is like this. I set 960px for the main; the combined width of the three divs inside is exactly equal to 960px. Firefox, Chrom, IE9, etc. can display normally, but under IE6, the right div will be squeezed down. Why?
.main{    margin-top: 5px;    width:960px;    margin:5px auto;    padding:0px;}.main .leftbar{    width:235px;    float:left;    margin-left: 5px;    overflow: hidden;}.main .middle{    width:450px;    float:left;    margin-left:15px;    margin-right:15px;    background-color: #F2F2F2;    overflow: hidden;}.main .rightbar{    float:right;    width:230px;    margin-right:5px;    overflow: hidden;}
Copy after login


Reply to discussion (solution)

Because under IE, the border is calculated as width, and floating elements may be doubled. Its width cannot be set to 3 DIVs equal to 960

IE6 browser has a double margin value BUG for floating elements. The solution is to set the display:inline; style of these three floating elements:

.leftbar, .middle, .rightbar { display:inline; }
Copy after login

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