我遇到了" text-align"属性因为在以下代码中不起作用:
<Titulo1>Title Text</Titulo1>
<BR>
<h1>Normal Text</h1>
CSS:
* {font-family: Arial; color: #2D2D2D}
Titulo1 {font-size: 40px; font-weight: 900; text-align: center}
TextoNormal {font-size: 30px; text-align: center}
以下是更多详细信息:http://jsfiddle.net/jB7X3/3/
答案 0 :(得分:4)
自定义标记默认为inline
元素。您需要向其添加display: block
。
<强> Demo 强>
CSS
* {
font-family: Arial;
color: #2D2D2D
}
Titulo1 {
font-size: 40px;
font-weight: 900;
text-align: center;
display: block /* add this if you wish to continue using your css */
}
TextoNormal { /* css property are not applied by content, so this will not work */
font-size: 30px;
text-align: center;
}
/* or a better way as in html */
<!-- or better way -->
<div>Title Text</div>
div{
text-align: center;
}
h1 {
text-align: center;
}