<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>
Copy after login
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>
Copy after login
. . 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?12345678
123456
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
Latest Articles by Author
-
2025-02-26 03:58:14
-
2025-02-26 03:38:10
-
2025-02-26 03:17:10
-
2025-02-26 02:49:09
-
2025-02-26 01:08:13
-
2025-02-26 00:46:10
-
2025-02-25 23:42:08
-
2025-02-25 22:50:13
-
2025-02-25 21:54:11
-
2025-02-25 20:45:11
Latest Issues
-
2025-03-21 18:33:45
-
2025-03-21 12:41:25
-
2025-03-21 12:40:34
-
2025-03-21 12:39:27
-
2025-03-21 12:37:30