课程
/前端开发
/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;}
设置为会计元素,text-align=“center”
举报
HTML(5)+CSS(3)基础教程8小时带领大家步步深入学习标签用法和意义
2 回答盒子问题!!!
7 回答css盒子问题
5 回答盒子大小问题。
7 回答盒子中内容不随边距而改变位置
1 回答关于在相对位置中加入盒子模型
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号