我想要一个与内容具有相同宽度的div,display: inline-block;
但是当我使用它时,text-align: center不再工作了.
所以我的内容只是左转,内联块适用于它.
像这样:
#div1 {
position: relative;
bottom: 10px;
left: auto;
text-decoration: overline underline;
display: inline;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
它不再以div的文本为中心.
我怎么能得到这两个效果?