The width of width:1050px is actually different under Chrome, Firefox and IE? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:29
Original
1501 people have browsed it

On the same machine, with just one width setting, the widths displayed in three browsers are actually different. IE8 is the longest, followed by Firefox.
Because we need to put a picture, the size of the picture is 1050px. The effect is best under Chrome. Due to zooming in other browsers, the effect is not very clear.
How to solve it?

  <div style="width:1050px;height:30px;background-color: blue"></div>
Copy after login


Reply to the discussion (solution)

All assignments such as margin padding border and the like are set to 0

Then it will be compatible with the browser.

Correct answer on the first floor, because each browser has a default attribute when parsing tags. Margin, padding and border are the most common. Assigning all values ​​to 0 can avoid problems.

will be different, some browsers will calculate the border into the width, and some will not.

Standing basic code. . . .

*{border:0;padding:0;margin:0;text-decoration:none;}
Copy after login

Newcomer, let’s go through the questions~ I’ve seen the fifth floor several times~ By the way, you seem to like that expression very much

Related labels:
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