html - 将带有 css 的下拉箭头添加到列表中的计数器集编号

标签 html css

我有一个 OL 列表

<ol id="checkout-progress-state" class="checkout-progress">
<li class="active first" title="Select Addresses">
<span>Select Addresses</span>
<span class="notch"></span>
</li>
<li title="Shipping Information">
<span>Shipping Information</span>
</li>
</ol>

我已将以下 css 添加到之前的状态以创建我可以设置样式的数字

ol{counter-reset: progress-counter;font-size: 20px;}
ol li {border-top: 0 none white;position: relative;overflow: visible;display:inline-block; list-style-type: none;margin-right: 15px;} 
.checkout-progress li:before {
content: counter(progress-counter);
    counter-increment: progress-counter;
    }
    .checkout-progress li:before {border: 1px solid; border-radius: 12px;padding: 0 8px;margin-right: 10px;}
        .checkout-progress li.active:before {border: 1px solid #E96200; border-radius: 4px;padding: 0 6px;color: white; background-color: #E96200;}
 .notch {
    position: absolute;
    left: -10px;
    bottom: 0;
    border-top: 10px solid red;
    border-right: 10px solid transparent;
    border-left: 10px solid transparent;
    border-bottom: 0;
    _border-right-color: pink;
    _border-left-color: pink;
    _filter: chroma(color=pink);
}

正如您从这个 fiddle (http://jsfiddle.net/euABv/) 中看到的那样,箭头位于左侧。我希望它低于橙色框编号。有没有办法用计数器重置号码来做到这一点?

这会创建我想要的数字样式。但 我想在数字框(事件状态)的底部添加一个缺口。

我向 li 添加了槽口信息并尝试定位它,但它不会显示在框的底部。

最佳答案

你可以试试这个。

只需在外部类中添加position:relative - li.active first

li.active first{
   position:relative;
}

那么,即使你复制了很多相同的元素,箭头也不会改变位置。
fiddle

关于html - 将带有 css 的下拉箭头添加到列表中的计数器集编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22847593/

相关文章:

html - Bootstrap 导航栏汉堡包正在打开但没有关闭

javascript - 识别用户位置/IP 和更改语言的网站。基于那个

html - 两个输入框使用一个标签,输入框没有正确排列

css - 通过应用溢出 : hidden to body. 阻止底层内容滚动为什么不呢?

html - 两个兄弟元素必须是同一类型才能折叠它们的边距吗?

javascript - 在视口(viewport)中的任何位置向 <div> 添加类 - 而不仅仅是在它出现时

html - CSS 布局 - 滚动在列的旁边不起作用

javascript - 定位一个dojo dijit.form.DropDownButton的内容?

html - Flexbox align-content spacebetween 不工作

html - 如何将表格中的列向左移动?