我刚入sublime的坑,打html。以前没什么开发经历。想
sublime吧
全部回复
仅看楼主
level 2
我刚入sublime的坑,打html。以前没什么开发经历。想问点基础的东西,一般让整个块文件居中于他的父元素,和让他居中于整个文本都用什么代码……
2017年10月24日 01点10分 1
level 3
不明所以
2017年11月08日 14点11分 2
level 1
我也是新手~分享一下。[哈哈]
<head>
...
<style type="text/css">
h1{text-align:center; }
.father{
width:500px;
background:#ccc;
display:table;
margin:0 auto;
}
.center{
text-align:center;
}
</style>
</head>
<body>
<h1>元素居中</h1>
<div class="father">
<p>父元素div居中</p>
</div>
<br/>
<div class="father">
<p class="center">子元素p在父元素div居中</p>
</div>
</body>
2017年11月23日 03点11分 3
1