【发布时间】:2020-08-31 01:05:17
【问题描述】:
<html>
<head>
<link rel="stylesheet" type="text/css" href="calendar.css">
</head>
<body>
<div class="textAreaWrapper">
<div class="textAreaWrapperPanel">
<h3 class='textblockheader'>Text Block Settings</h3>
</div>
</div>
</body>
</html>
这是我的html代码,下面是我的css代码:
.textAreaWrapper{
border: 1px solid black;
background-color: white;
}
.textAreaWrapperPanel{
background-color : #093459;
color: white;
margin-top:0px;
}
.textblockheader{
font-family : "Helvetica Neue,Helvetica,Arial,sans-serif";
font-size: 16px;
font-weight : normal;
}
我希望textAreaWrapperPanel 和textAreaWrapper div 元素之间没有空格,但它仍然有。但是如果我将textblockheader 的margin-top 更改为0px,它的工作原理,谁能解释为什么会发生这种情况?
【问题讨论】: