【发布时间】:2015-03-06 11:20:50
【问题描述】:
我想让我的文本降低我的文本以使其位于<div> 标记的中心。但我尝试使用margin-top 使其降低一点,但它无法正常工作。这是我的代码。
.loremipsum {
background-color: white;
height: 1060px;
}
.content {
font-family: 'Lato';
text-align: center;
}
h3 {
font-size: 75px;
}
.h3 {
border: 2px black solid;
width: 750px;
margin: auto;
margin-top: 100px;
}
<div class="loremipsum" id="loremipsum" >
<div class="h3">
<h3 class="content" >Why Choose Us?</h3>
</div>
<p class="content">We create the best front-end design.Each template cost only $5.</p>
</div>
【问题讨论】:
-
为什么不直接将
padding添加到它的容器中? -
你为什么使用
jQuery和JavaScript标签? -
@MelanciaUK,填充也不起作用。
-
@MikeYung:您仍然可以使用开发工具(例如,使用 google chrome 进行调试)
-
你听起来很迷茫,恐怕。老实说,我建议您在尝试编码之前花一些宝贵的时间阅读教程和其他材料,让您有一个开始。