gpt4 book ai didi

html - 分词 css 未相应对齐

转载 作者:太空宇宙 更新时间:2023-11-04 02:50:11 26 4
gpt4 key购买 nike

有没有办法让单词正确对齐?我尝试添加 word-break 和 word-wrap 属性,但没有任何不同。

enter image description here

<div class="transreview" style="float: right; background-color: #e0e0e0;   word-wrap: break-word; border-radius: 5px; padding: 10 20 10 20px;">

<div class="transreview-item" style="float: right; clear: both; width: 100%; margin-bottom: 10px;">

<label class="transreview-label" style="clear: both; width: 79%; text-align: right;"><b>Subtotal</b></label>

<div class="review-label" style="float: right; text-align: right; height: 20px; width: 120px; padding: 5 5 5 5px">S$42.50</div>
</div>

<div class="transreview-item" style="float: right; clear: both; width: 100%; margin-bottom: 10px;">

<label class="transreview-label" style="clear: both; width: 79%; text-align: right;"><b>Total Shipping</b></label>

<div class="review-label" style="float: right; text-align: right; height: 20px; width: 120px; padding: 5 5 5 5px">S$42.50</div>
</div>
</div>

最佳答案

把它变成一个表格。我做了一个Fiddle .只需调整 CSS,您应该会得到相同的结果。但是不要添加内联 CSS!

HTML

<table>
<tbody>
<tr>
<td>
Subtotal
</td>
<td>
<label>
S$42.50
</label>
</td>
</tr>
<tr>
<td>
Total Shipping
</td>
<td>
<label>
S$42.50
</label>
</td>
</tr>
<tr>
<td>
Tax
</td>
<td>
<label>
S$42.50
</label>
</td>
</tr>
<tr>
<td>
Discount
</td>
<td>
<label>
S$42.50
</label>
</td>
</tr>
<tr>
<td>
Total (including tax, if applicable)
</td>
<td>
<label>
S$42.50
</label>
</td>
</tr>
</tbody>
</table>

CSS

table{
background-color: #E0E0E0;
border-radius: 5px;
padding: 4px 0;
}

td label{
background-color: #FFF;
border-radius: 5px;
padding: 4px 4px 4px 20px;
}

td{
padding: 4px;
}

关于html - 分词 css 未相应对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33164866/

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