Html 添加边框后无法将边距添加到我的h1
我的h1工作正常,直到我添加了一个边框并使其内联显示。现在,无论我怎么做,我都无法在h1的顶部添加边距。现在整个边界的顶部都被切断了 如果我删除display:inline,标题会移回更有意义的位置,但边框会延伸到整个页面,而不是环绕文本Html 添加边框后无法将边距添加到我的h1,html,css,margin,Html,Css,Margin,我的h1工作正常,直到我添加了一个边框并使其内联显示。现在,无论我怎么做,我都无法在h1的顶部添加边距。现在整个边界的顶部都被切断了 如果我删除display:inline,标题会移回更有意义的位置,但边框会延伸到整个页面,而不是环绕文本 h1 { border: 3px greenyellow solid; margin-top: 100px; border-width: 8px; display: inline; padding:
h1 {
border: 3px greenyellow solid;
margin-top: 100px;
border-width: 8px;
display: inline;
padding: 10px;
border-radius: 25%;
text-align: center;
font-size: 90px;
}
添加
内联块
h1 {
border: 3px greenyellow solid;
margin-top: 100px;
border-width: 8px;
display: inline-block;
padding: 10px;
border-radius: 25%;
text-align: center;
font-size: 90px;
}
您是否尝试将“显示”设置为“内联”块而不是“内联”块?非常感谢您,立即修复了它。这是我的第一个网站,非常感谢您抽出时间:)