Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用方法:第三次使用前<;李>;元素?_Html_Css_Css Selectors - Fatal编程技术网

Html 使用方法:第三次使用前<;李>;元素?

Html 使用方法:第三次使用前<;李>;元素?,html,css,css-selectors,Html,Css,Css Selectors,如何在第三个元素之前添加,而不添加任何新的类或id 这是你的电话号码 HTML: 这样,它始终是最后一个(如果您有3个以上) 对于不支持伪类的旧浏览器,您可以按如下方式使用: .breadcrumb任务li+li+li:之前{ 内容:“>\00a0”; } 并覆盖4th和5th的内容,。。。将项目列为: .breadcrumb tasks li+li:before,/*选择第二个+列表项*/ .breadcrumb任务li+li+li+li:在{/*选择第四个+列表项之前*/ 颜色:#ccc;

如何在第三个
  • 元素之前添加
    ,而不添加任何新的类或id

    这是你的电话号码

    HTML:


    这样,它始终是最后一个(如果您有3个以上)


    对于不支持伪类的旧浏览器,您可以按如下方式使用:

    .breadcrumb任务li+li+li:之前{
    内容:“>\00a0”;
    }
    
    并覆盖4th5th
    内容,。。。将项目列为:

    .breadcrumb tasks li+li:before,/*选择第二个+列表项*/
    .breadcrumb任务li+li+li+li:在{/*选择第四个+列表项之前*/
    颜色:#ccc;
    内容:“/\00a0”;
    }
    

    但对于现代浏览器(包括IE9+):

    .breadcrumb任务李:第n个孩子(3):之前{
    内容:“>\00a0”;
    }
    

    请在这里发布您的代码。是的!很好用!(我加了一把小提琴)。希望这有帮助@我不知道我没有投票的名声
    <ol class="breadcrumb-tasks">
      <li>Ethernet</li>
      <li>Compputer</li>
      <li>Design</li>
    </ol>
    
    li:nth-child(3):before
    {
        content: ">";
    }
    
    .breadcrumb-tasks li:last-child:before { content: "› "; }
    
    ol li:last-child:before{
        content: ">";
    }