LI 上的 CSS 箭头

标签 css

尝试使用 http://www.dinnermint.org/css/creating-triangles-in-css/ 创建箭头的方法

 _________________
 \                \
  \   Lorem        \
  /                /
 /________________/

仅使用

  <div id="sidebar">
        <ul>
            <li>Lorem</li>
            <li>Aliquam</li>
            <li>Vestibulum</li>
        </ul>
    </div>

我宁愿不使用图像或 jquery,而只使用 css

我已经可以使用了

    <div id="sidebar">
    <ul>
        <li>
            <div class="notch">
            </div>
            Lorem<div class="point">
            </div>
        </li>
        <li>
            <div class="notch">
            </div>
            Aliquam<div class="point">
            </div>
        </li>
        <li>
            <div class="notch">
            </div>
            Vestibulum<div class="point">
            </div>
        </li>
    </ul>
</div>
<style type="text/css">
    #sidebar ul { margin: 0 0 0 0; }
    #sidebar li { background: none repeat scroll 0 0 #336699; color: White; font-size: 25px; list-style: none outside none; margin: 25px 0; padding: 0 0 10px; text-align: center; vertical-align: middle; }
    .notch { float: left; border-color: Transparent Transparent Transparent White; border-style: solid; border-width: 20px; width: 0; height: 0; }
    .point { float: right; border-color: White White White Transparent; border-style: solid; border-width: 20px; width: 0; height: 0; }
</style> 

但不想在 html 中包含所有设计内容

最佳答案

使用以下内容:

<ul style="list-style-type:none;">
<li>&rarr; List</li>
<li>&rarr; Etc.</li>
</ul>

这将显示为:

→列表
→ 等

关于LI 上的 CSS 箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3827921/

相关文章:

javascript - 将外部页面加载到DIV中,并将外部页面样式表的效果限制在该DIV中

html表格间距和边距错误

html - Flexbox 页脚不堆叠在其他 div 下

javascript - Chrome JavaScript slider 问题

css - 是否有 CSS 父级选择器?

css - 使用 CSS 跨浏览器自定义形状

html - 我想以这样的方式对齐我的图像,其中 2 个图像位于其他 2 个图像之上,使用 html 如图所示,每个图像下方都有一些文本

html - 悬停时如何停止圆圈上的抖动

jquery - 如何使用Javascript将原始高度返回为动态高度内容?

html - Chrome 为滚动条保留空间,即使它是隐藏的