Home >Web Front-end >HTML Tutorial >Can a css expert help me? Why is there always a gap between the browser and the div in this code? _html/css_WEB-ITnose

Can a css expert help me? Why is there always a gap between the browser and the div in this code? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:13:011117browse

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>东有限公司</title><style type="text/css">/* CSS Document */html{padding:0;margin:0;}body{margin:0;padding:0;text-align:center; font-family:"宋体"; font-size:12px; color:#001080; line-height:22px;background-color:#EAEAEA;}#header{ width:963px; height:68px;margin:0 auto;background-color:#FFFFFF;padding-left:19px;padding-right:20px;}</style></head>  <body><div id="header"> </div></body></html>


I also tested it on others. Why do I have to write it by hand to solve it? I don’t want to write it by hand, because this is the remaining few pieces of code after I deleted the entire page~···


Reply to the discussion (solution)

# header{Add a margin-top:-22px and try}

line-height:22px; Remove this. What are you doing with it?

8d2c2a8eff5035fb68199fd4e653ca2c
68ccb177a5de0ef9542dde7d35bae727
93f0f5c25f18dab9d176bd4f6de5d30e
c81dfe2785f3609ed030a93dd4e32486
b2386ffb911b14667cb8f0f91ea547a7East Co., Ltd.6e916e0f7d1e588d4f442bf645aedb2f
080b747a20f9163200dd0a7d304ba388
/* CSS Document */
*{padding:0;margin:0}
html{padding:0;margin:0;}
body{margin:0;padding:0;text-align:center; font-family:"宋体"; font-size:12px; color:#001080; line-height:22px;background-color:#EAEAEA;}
#header{ width:963px; height:68px;margin:0 auto;background-color:#FFFFFF;padding-left:19px;padding-right:20px;}
531ac245ce3e4fe3d50054a55f265927
9c3bca370b5104690d9ef395f2c5f8d1
6c04bd5ca3fcae76e30b72ad730ca86d
e03a727e055b9c25b65f84e28b3f96b816b28748ea4df4d9c2150843fecfba68
36cc49f0c466276486e50c850b7e4956
. . How to respond one to one?

None of them. . . You can call it yourself on the third floor. . I've said it before, why do you have to fight it yourself? .

None of them. . . You can call it yourself on the third floor. . I've said it before, why do you have to fight it yourself? .

I didn’t type it by hand, I pasted it directly to yours. If there is a space after your 9c3bca370b5104690d9ef395f2c5f8d1, just remove it.

9c3bca370b5104690d9ef395f2c5f8d1 ■■


1508854e621bcc48005def8b76962b64 tag!

9c3bca370b5104690d9ef395f2c5f8d1 There are three special characters after this line, which can be seen by opening it with notepad.

9c3bca370b5104690d9ef395f2c5f8d1 There are three special characters after this line, which can be seen by opening it with notepad.

1

Quote from the 9th floor’s reply:

9c3bca370b5104690d9ef395f2c5f8d1 There are three special characters after this line, which can be seen by opening it with notepad.

1

Yeah. . Solved, what the hell is coming, can’t be seen. Adding spaces back doesn't work. However, the problem on my original page has not been solved yet ~ · faint

I don’t know what you mean by there is a gap between the browser and the head.
You have # in front of head in the css, and head width = 963px will affect the format. I don’t know what the effect you want is.

Quote from the 10th floor’s reply:


Quote from the 9th floor’s reply:

9c3bca370b5104690d9ef395f2c5f8d1 There are three special characters after this line, you can see it when you open it with notepad.


1

Yeah. . Solved, what the hell is coming, can’t be seen. Adding spaces back doesn't work. However, the problem on my original page has not been solved~· faint
The one that existed before was full code, and the one you added later is different from the previous one

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