gpt4 book ai didi

html - 居中左对齐文本

转载 作者:行者123 更新时间:2023-11-28 16:38:06 25 4
gpt4 key购买 nike

我想在黄色框 (txtbox) 中居中左对齐文本。现在看起来像这样:

http://i.imgur.com/A1LaF0d.png

它希望它看起来像这样:

http://i.imgur.com/yHNjFqk.png

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com