拥有 center 类的 HTML 元素均为居中
2019年11月30日
作者:佚名
在上面的例子中,全部拥有 center 类的 HTML 元素均为居中。
不才面的 HTML 代码中,h1 和 p 元素都有 center 类。这象征着两者都将屈从 ".center" 决定器中的划定规矩。
<h1 class="center"> This heading will be center-aligned </h1> <p class="center"> This paragraph will also be center-aligned. </p>
留意:类名的第一个字符不能运用数字!它没法在 Mozilla 或 Firefox 中起感导。