我想在黄色框 (txtbox) 中居中左对齐文本。 现在看起来像这样:
它希望它看起来像这样:
HTML:
<div class="content container small">
<div class="txtbox">
<header style="text-align:left;">
<h2>I AIN'T</h2>
<h2>AN ARTIST.<h2>
<h2>I'M A</h2>
<h2>BEAST!</h2>
</header>
</div>
<footer>
<a href="#one" class="button style2 down">More</a>
</footer>
</div>
CSS:
.container.small {
/* width: (containers) * 0.75; */
width: 900px;
}
.txtbox{
width:800px;
margin:0 auto;
background-color:yellow;
text-align:center;
}
最佳答案
.txtbox header h2{
padding-left: 50px;
}
关于html - 居中左对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24972080/