Home > Web Front-end > HTML Tutorial > A piece of code about float not supported by IE7 or above and FF browser_html/css_WEB-ITnose

A piece of code about float not supported by IE7 or above and FF browser_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:24:13
Original
1045 people have browsed it

ie7 firefox chrome ie8 float

The code is as follows:
.....
#a{
width:100px;
height:100px;
background- color:red;
border:5px solid #bbbbbb;
float:left;
}
#b{
width:100px;
height:100px;
background- color:green;
border:5px solid #bbbbbb;
}
#c{
width:100px;
height:100px;
background-color:yellow;
border:5px solid #bbbbbb;
float:left;
}
......
11

< div id="b">22

33

.......

My question Yes, why does it display "normal" under IE7

but "abnormal" under IE8/9, firefox and chrome? So how do I display it normally under IE8/9, firefox and chrome? ?

Reply to discussion (solution)

        #a        {            width: 100px;            height: 100px;            background-color: red;            border: 5px solid #bbbbbb;            float: left;        }        #b        {            width: 100px;            height: 100px;            background-color: green;            border: 5px solid #bbbbbb;            display:inline-block;        }        #c        {            width: 100px;            height: 100px;            background-color: yellow;            border: 5px solid #bbbbbb;        }
Copy after login
Copy after login
Copy after login

in Chrome and IE9

        #a        {            width: 100px;            height: 100px;            background-color: red;            border: 5px solid #bbbbbb;            float: left;        }        #b        {            width: 100px;            height: 100px;            background-color: green;            border: 5px solid #bbbbbb;            display:inline-block;        }        #c        {            width: 100px;            height: 100px;            background-color: yellow;            border: 5px solid #bbbbbb;        }
Copy after login
Copy after login
Copy after login

in Chrome and IE9

Thanks for the answer! What is the principle of this?


        #a        {            width: 100px;            height: 100px;            background-color: red;            border: 5px solid #bbbbbb;            float: left;        }        #b        {            width: 100px;            height: 100px;            background-color: green;            border: 5px solid #bbbbbb;            display:inline-block;        }        #c        {            width: 100px;            height: 100px;            background-color: yellow;            border: 5px solid #bbbbbb;        }
Copy after login
Copy after login
Copy after login

in Chrome and IE9

Thanks for the answer! What is the principle of this?

It’s just browser style recognition, the same attributes are recognized differently

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template