我想中心与ID =“中心”的div在身体标记垂直和水平不扭曲的内容放置:M,cicle div和即将推出...文本。不能真正得到它,甚至工作,但它应该是一件简单的事情..居中div水平和垂直没有扭曲的内容
HTML:
<body>
<div id="center">
<div class="circle"><div>M</div></div>
<h2>Coming soon...</h2>
</div>
</body>
CSS:
* {
margin: 0;
padding: 0;
font-family: futura;
}
body {
height: 100%;
width: 100%;
background-color: black;
}
h2 {
color: #f6c003;
font-family: serif;
font-style: italic;
font-weight: 400;
font-size: 0.9em;
margin-top: 10px;
}
.circle {
text-align: center;
width: 50px;
height: 50px;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
background: #f6c003;
}
.circle div {
float:left;
width:50px;
padding-top:25px;
line-height:1em;
margin-top:-0.5em;
text-align:center;
color:black;
font-style: bold;
font-weight: 700;
font-family: serif;
font-size: 2.5em;
}
问如何将一个占据整个宽度的元素居中没有意义... – CBroe