我的站点中有一个 span
标记。
我想在页面中心对齐 span 的文本。
<span id="notice">Please Read the notice</span>
我正在使用 CSS 像下面那样做。
#notice{
color:#D05679;
font-family: Signika;
font-size:15px;
text-align:center;
}
但这行不通。请提出建议。
PS:谢谢大家的回答。他们都工作。我犯了一个愚蠢的错误。
最佳答案
试试这个..
#notice{
color:#D05679;
font-family: Signika;
font-size:15px;
text-align:center;
}
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<body>
<div id="notice">
<span >Please Read the notice</span>
</div>
</body>
</html>
关于html - 在页面中心对齐 span 的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34039792/