Home >Web Front-end >HTML Tutorial >I have a problem to solve_html/css_WEB-ITnose

I have a problem to solve_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:17:44971browse

					<div style="width:100%;height:29px;font-family:宋体;font-size:14px">						123456					</div>					<div style="width:100%;height:1px;background-color:#000">					</div>					<div style="width:100%;height:29px;font-family:宋体;font-size:14px">						123456					</div>

Why does the middle div with a height of 1 pixel become 18 pixels in IE8? Anyone who knows, please tell me
Or it can solve the difference between the borders of IE and Chrome browsers
ie border = length * width
Others = length * width border


Reply to discussion (solution)

Use css hack, different browsers do not support individual attributes Same, then set it for individual attributes

Because IE has a default height, just set overflow:hidden. .

<div style="width:100%;height:29px;font-family:宋体;font-size:14px">    123456</div><div style="width:100%;height:1px;background-color:#000;overflow:hidden"></div><div style="width:100%;height:29px;font-family:宋体;font-size:14px">    123456</div>

. . I'm a step behind the moderator, I just tried it myself
I did add this
overflow:hidden;

I'm 2, so I tried it myself without reading the reply. . .

Because IE has a default height, just set overflow:hidden. .

XML/HTML code?12345678984ae260929a18f427feea66f1a526b9 12345616b28748ea4df4d9c2150843fecfba68

Statement:
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