美好的一天,我与使用CSS创建HTML元素看起来的具体结构麻烦如下:如何将零线高度的div文本元素居中?
我tryings与此结束建议:
我试着以编程的方式来做,但总是当我将数字和字符串之间的行高CSS属性设置为空时,div的整个内容自然会被推得更高,而且我不能直接将它中间。即使使用像素推动,它也可能很痛苦而且不准确。
<!DOCTYPE html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<style>
.circle
{
width: 100px;
height: 100px;
background: red;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
}
</style>
<body>
<div style="margin-left:100px;">
<div align="center" class="circle">
<h1>9</h1>
<p>LEVEL</p>
</div>
</div>
</body>
</html>
我试图使用任何边距或高度属性,但没有积极的结果。这是我的问题,现在怎么看:
你有任何想法如何编程修复它? (任何其它类似的问题didn't帮我,感谢您的时间)
感谢您的回答与线高度:0 ......这对我有用,我会记住你的解决方案,再次感谢 –