gpt4 book ai didi

html - div 之间的空白

转载 作者:行者123 更新时间:2023-11-28 01:11:45 24 4
gpt4 key购买 nike

我在底部和顶部的 div 之间出现空白(水平),我不知道原因。

#header {
display: inline-block;
float: left;
width: 100%;
height: auto;
}
#header #date {
display: inline-block;
float: left;
width: 100%;
height: auto;
}
#header #date #date_day_month {
display: inline-block;
float: left;
width: 100%;
height: auto;
line-height: 75px;
background-color: #E96567;
color: #FFF;
text-align: center;
font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
font-size: 35px;
margin: 0px;
}
#header #date #date_day {
display: inline-block;
float: left;
width: 100%;
height: auto;
line-height: 40px;
background-color: #DB5658;
color: #FFF;
text-align: center;
font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
font-size: 17px;
margin: 0px;
}
#header #logo {
display: inline-block;
float: left;
height: auto;
width: 100%;
background-color: #DB5658;
min-height: 30px;
}
#header #logo_comment {
display: inline-block;
float: right;
height: 40px;
border-top-left-radius: 110%;
background-color: #FFF;
width: 60%;
text-align: right;
line-height: 40px;
font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
font-size: 14px;
padding: 0px 10px 0px 10px;
}
<body>
<div id="header">
<div id="date">
<div id="date_day_month">
hoi
</div>
<div id="date_day">
hoi
</div>
</div>
<div id="logo">
<div id="logo_comment">
Hoi
</div>
</div>

</div>
</body>

我注意到当我在堆栈中运行这段代码时,这个问题并不活跃。但是在 fiddle 中它显然适合我。

http://jsfiddle.net/njk96/28/

------------------------ 编辑:

在我的戴尔 xps 13 (9434) 上使用最新版本的 chrome,没有放大或缩小。 http://postimg.org/image/ggbkubiyz/ (我的截图)

最佳答案

body {
display: initial;
}

或使用:

body {
display: inline;
}

发件人:https://developer.mozilla.org/en-US/docs/Web/CSS/initial

The initial CSS keyword applies the initial value of a property to an element. It is allowed on every CSS property and causes the element for which it is specified to use the initial value of the property.

关于html - div 之间的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37394260/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com