【发布时间】:2021-04-15 00:36:01
【问题描述】:
我不得不使用提供的 HTML 标记并且无法更改它。我想要做的是在“SALE”下方的左侧显示正常价格,即:
售价 5 美元
10 美元
有没有办法解决这个问题?我完全可以将正常价格定位在左侧,但如果存在的话,我希望做一个更有说服力的解决方案吗?
.label {
float: left;
margin: 0 5px 0 0;
}
.special-price,
.label {
color: red;
}
.price {
display: flex;
flex-direction: column-reverse;
}
<div class="wrapper">
<div class="label">
<!-- Label text can vary i.e. sale, discontinued etc -->
SALE
</div>
<div class="price">
<div class="regular-price">
$10
</div>
<div class="special-price">
$5
</div>
</div>
</div>
【问题讨论】:
-
你试过
margin-left:;或margin-right:; -
我只想更改 HTML