我的 h1 工作正常,直到我添加边框并使其内联显示。现在无论我尝试什么,我都无法在 h1 的顶部添加边距。现在边界的整个顶部都被切断了。
https://dash.generalassemb.ly/Astara303/build-your-own-personal-website
如果我删除显示:内联标题会移回更有意义的位置,但边框延伸到整个页面而不是环绕文本。
h1 {
border: 3px greenyellow solid;
margin-top: 100px;
border-width: 8px;
display: inline;
padding: 10px;
border-radius: 25%;
text-align: center;
font-size: 90px;
}
添加inline-block
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;
}