課程
/前端開發(fā)
/HTML/CSS
/初識(shí)HTML(5)+CSS(3)-升級版
我看到效果中文字是居中了,但不清楚這樣寫正不正確....
2015-08-22
源自:初識(shí)HTML(5)+CSS(3)-升級版 15-2
正在回答
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定寬塊狀元素水平居中</title>
<style>
div{
? ? border:1px solid red;
? ? width:500px;
margin:auto;
}
p.test{
? ? text-align:center;
</style>
</head>
<body>
<div><p class="test"><span>我是定寬塊狀元素,哈哈,我要水平居中顯示。</span></p></div>
</body>
</html>
文字居中教你絕招 ? line-height:你父級元素的高度
舉報(bào)
HTML(5)+CSS(3)基礎(chǔ)教程8小時(shí)帶領(lǐng)大家步步深入學(xué)習(xí)標(biāo)簽用法和意義
1 回答定寬塊狀元素的水平居中設(shè)置
1 回答水平居中設(shè)置-定寬塊狀元素
4 回答定寬塊狀元素_水平居中設(shè)置
1 回答css水平居中設(shè)置定寬塊狀元素
2 回答在設(shè)置定寬塊狀元素的水平居中時(shí)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2015-11-04
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定寬塊狀元素水平居中</title>
<style>
div{
? ? border:1px solid red;
? ? width:500px;
margin:auto;
}
p.test{
? ? text-align:center;
}
</style>
</head>
<body>
<div><p class="test"><span>我是定寬塊狀元素,哈哈,我要水平居中顯示。</span></p></div>
</body>
</html>
2015-08-24
文字居中教你絕招 ? line-height:你父級元素的高度