[英]CSS3 Heading Issue
I am scratching my head to resolve this issue but without success. 我正在努力解决这个问题,但没有成功。 It is very simple: a
div
with rounded corners with a h3
on the top (I am trying to simulate a panel with title), very simple. 这非常简单:非常简单,一个带有圆角的
div
(顶部带有h3
(我正在尝试模拟一个带标题的面板)。
For some reason, the h3
always has a space, feels like it has a margin or something. 由于某种原因,
h3
总是有一个空格,感觉好像有一个空白或其他东西。
.example-wrapper { border: 1px solid #555; border-radius: 10px 10px 0 0;} .example-wrapper h3 { background: #555; color: #fff; border-radius: 10px 10px 0 0; padding: 10px; font-size: 16px;}
<DIV class="example-wrapper"> <H3>Herry Potter</H3> </DIV>
Any comments would be appreciated. 任何意见,将不胜感激。
Yes, H#
has margins by default. 是的,
H#
默认情况下具有边距。 Set H3{ margin: 0; }
设置
H3{ margin: 0; }
H3{ margin: 0; }
to solve it. H3{ margin: 0; }
解决这个问题。 You can always use developer tools to inspect elements and see any style applied to them. 您始终可以使用开发人员工具来检查元素并查看应用于它们的任何样式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.