html - 由于某种原因无法看到border-top
问题描述
边框顶部被页面顶部截断??
我尝试设置 h2 元素的 margin-top ,但结果仍然相同。
body {
font-family: 'Open Sans', sans-serif;
height: auto;
margin: 0;
background: #222;
}
#heading-background {
background: #55d6aa;
height: 50px;
color: rgba(255, 255, 255, 1);
}
h2 {
color: #222;
padding: 0 0 0 14px;
margin: 10px 0 0 20px;
font-size: 28px;
letter-spacing: 0.5em;
display: inline;
border: 2px solid #222;
border-radius: 8px;
}
<div id="heading">
<div id="heading-background">
<div id="heading-text">
<h2>TODO</h2>
</div>
</div>
</div>
解决方案
这将完成工作 h2 { display: inline-block; }
推荐阅读
- android - 无符号类型和jetpack compose
- python - Pandas 数据框过滤掉非英文文本的行
- java - “mailR”包的问题 - 在 RJavaClassLoader.findClass 处给出 java.lang.ClassNotFoundExceptio
- javascript - 如何在 Postman 中“以编程方式”设置集合变量的初始值?
- r - panelAR:相同的回归与更多的观察导致记忆错误
- javascript - 检查数组数组是否包含javascript中的值
- django - Django 中的模型字段
- android - 错误:找不到吸气剂:“小部件”。小部件.icon
- spring - 具有原生查询的基于类的投影
- javascript - Next.js - 预期的服务器 HTML 包含匹配在