<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
我最近在这个网站上做了一个简单的文本更改,突然文本不会居中。我根本没有接触 CSS,无法弄清楚是什么原因造成的。
这是链接: http://newyork-fashionweek.com/
我所指的文本位于“门票”部分,上面写着“购买”。 请帮忙?
谢谢。
附言您可以通过单击“加入”而不输入电子邮件来绕过电子邮件注册。
最佳答案
您正试图将 <span>
中的文本居中.您不能在内联元素内部居中。您只能在 block 级元素内居中。将其更改为 <div>
而不是 <span>
.如果你必须有一个内联元素,那么改变 <div>
显示属性到 display: inline-block
.
关于html - "text-align:center"文本更改后不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35708697/
相关文章:
html - CSS :hover not working after applying both :before and :after on the same element
javascript - JavaScript 中的定时器控制
javascript - 为什么我无法打印重叠矩形的 id?
javascript - 隐藏元素 'grandparent' 的 Angular 指令
javascript - 如何使用 Javascript(jQuery 或 Angular)在语义 UI 中启用禁用的步骤
html - 在 ActionView::Base.full_sanitizer 中允许 CDATA