課程
/前端開發(fā)
/HTML/CSS
/初識HTML(5)+CSS(3)-升級版
怎么讓盒子2個字位于這個正方形框的中間。
2016-07-06
源自:初識HTML(5)+CSS(3)-升級版 12-12
正在回答
用text-align:center
和line-height 來居中
慕粉3344523 提問者
#box1{
? ? text-align: center;
? ? width:100px;
? ? height:100px;
?? line-height:100px;
? ? border:1px solid red;
}
?是正確的
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>填充</title>
<style type="text/css">
? ? padding:10px;
</style>
</head>
<body>
<div id="box1">
? ? <pre> </pre>盒子1
</div>
</body>
</html>
box{padding:1px? 1px 1px? 40px;}
設(shè)置為會計(jì)元素,text-align=“center”
舉報
HTML(5)+CSS(3)基礎(chǔ)教程8小時帶領(lǐng)大家步步深入學(xué)習(xí)標(biāo)簽用法和意義
2 回答盒子問題?。?!
7 回答css盒子問題
5 回答盒子大小問題。
1 回答關(guān)于在相對位置中加入盒子模型
7 回答盒子中內(nèi)容不隨邊距而改變位置
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-07-06
用text-align:center
和line-height 來居中
2016-07-06
#box1{
? ? text-align: center;
? ? width:100px;
? ? height:100px;
?? line-height:100px;
? ? border:1px solid red;
}
?是正確的
2016-07-06
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>填充</title>
<style type="text/css">
#box1{
? ? text-align: center;
? ? width:100px;
? ? height:100px;
? ? padding:10px;
? ? border:1px solid red;
}
</style>
</head>
<body>
<div id="box1">
? ? <pre> </pre>盒子1
</div>
</body>
</html>
2016-07-06
box{padding:1px? 1px 1px? 40px;}
2016-07-06
設(shè)置為會計(jì)元素,text-align=“center”