我有一个包含两个步骤的脚本,我想要对齐文本,例如:
Step1 : I am a boy........
my name is Ram```
但是我想将文本对齐为
Step1 : I am a boy........
my name is Ram```
我尝试使用text-align和align属性来定位跨度元素。
p.steps {
color: #000;
margin-bottom: 10px;
font-size: 20px;
font-weight: normal;
font-family: 'Montserrat';
line-height: 1.2;
margin-top: 20px;
text-align: left;
}
<p class="steps"> <span style="color:#BB2812">Step1 : </span> I am a boy................. my name is Ram</p>
<p class="steps"> <span style="color:#BB2812">Step2 : </span> There are many countries but I live in Australia </p>
text-indent
。 - akaBasedisplay:flex
添加到.steps
,并将white-space:nowrap;
添加到span
。 - AbbasEbadian