gpt4 book ai didi

html - 如何在 css : product. ..(价格)中设置样式?

转载 作者:太空狗 更新时间:2023-10-29 13:14:27 24 4
gpt4 key购买 nike

我很难解释我想在一个问题中达到什么目的。我实际上是在一个 fiddle 中构建它的,但我知道他们必须是一种更聪明的方法来做到这一点:http://jsfiddle.net/4QgtM/1/



我要实现的目标

Car ............................... $2000Boat ............................. $20000Airplane ........................ $200000



What I've got (Hack)

<ul>
<li><a href="javascript:void(0)">Car</a><i></i><span>$2000</span></li>
<li><a href="javascript:void(0)">Boat</a><i></i><span>$20000</span></li>
<li><a href="javascript:void(0)">Airplane</a><i></i><span>$200000</span></li>

有没有人有实现这一目标的聪明方法?谢谢!

最佳答案

检查一下...(灵感来自 this)

Fiddle

CSS:

ul.leaders {
max-width: 40em;
padding: 0;
overflow-x: hidden;
list-style: none
}
ul.leaders li:before {
float: left;
width: 0;
white-space: nowrap;
content:". . . . . . . . . . . . . . . . . . . . "". . . . . . . . . . . . . . . . . . . . "". . . . . . . . . . . . . . . . . . . . "". . . . . . . . . . . . . . . . . . . . "
}
ul.leaders span:first-child {
padding-right: 0.33em;
background: white
}
ul.leaders span + span {
float: right;
padding-left: 0.33em;
background: white
}

HTML:

<ul class=leaders>
<li><span><a href="javascript:void(0)">Car</a></span>
<span>$200</span>

<li><span><a href="javascript:void(0)">Boat</a></span>
<span>$2000</span>

<li><span><a href="javascript:void(0)">Airplane</a></span>
<span>$20000</span>

<li><span><a href="javascript:void(0)">Hover craft</a></span>
<span>$200000</span>

<li><span><a href="javascript:void(0)">Supersonic futuristic machine</a></span>
<span>$2000000</span>
</ul>

“仅作记录”:
- 另一种解决方案是在 img/png 中有一个小点作为背景。 (背景:#FFF url(image.pn) repeat-x;
- 另一种解决方案是使用 border-bottom: dotted;

关于html - 如何在 css : product. ..(价格)中设置样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17312503/

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