Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.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 - Fatal编程技术网

Html 嵌套跨越一系列台阶,就像楼梯一样

Html 嵌套跨越一系列台阶,就像楼梯一样,html,css,Html,Css,我正在尝试创建以下布局 Stuff » More Stuff » Children » FirstChild » SecondChild » ThirdChild <span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild&l

我正在尝试创建以下布局

Stuff » More Stuff » Children » FirstChild  
                                  » SecondChild  
                                      » ThirdChild
<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>
由于使用CRM系统,我有一些限制,因此呈现的html如下所示:

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

是否可以执行我正在尝试的操作?

您应该在此处使用
ul
li
元素和
文本缩进
属性

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>
在这里,我使用了一个嵌套的
ul
li
元素,这些元素都是从零开始制作的,为了达到您想要的效果,我使用了
nth-
类型,这样您就不必修改DOM,并使用
文本缩进来轻推文本

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>
而言,使用它很重要,如果你想要解释,你可以参考我的其他答案

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

使用箭头,您可以使用
:before
:after
伪元素,如

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

您应该在这里使用
ul
li
元素和
文本缩进
属性

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>
在这里,我使用了一个嵌套的
ul
li
元素,这些元素都是从零开始制作的,为了达到您想要的效果,我使用了
nth-
类型,这样您就不必修改DOM,并使用
文本缩进来轻推文本

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>
而言,使用它很重要,如果你想要解释,你可以参考我的其他答案

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

使用箭头,您可以使用
:before
:after
伪元素,如

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

多亏了外星人先生,我才得以完成这件事

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

多亏了外星人先生,我才得以完成这件事

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

<span>Stuff » More Stuff » Children <span class="breadcrumbItem">» FirstChild</span>
                                    <span class="breadcrumbItem" style="margin-left:10px">» SecondChild</span></span>
                                        <span class="breadcrumbItem" style="margin-left:20px">» ThirdChild</span>
                                                </span>

你必须使用跨距吗?一个
ul/li
安排会更有意义。你必须使用跨度吗?一个
ul/li
的安排会更有意义。谢谢,让我头疼的问题是,我正在使用一个名为“卓越”的CRM系统,我正在将这些“孩子”附加到他们的模块头上。这是一个TR>TD>H2>a>SPAN-SPAN,我的孩子将被追加到最后一个SPAN中。@AdamWhite如果你有JS控件,你可以将元素追加到这些SPAN-SPAN的周围,让我头疼的问题是我正在使用一个名为pulend的CRM系统,我正在将这些“孩子”追加到他们的模块头上。这是一个TR>TD>H2>a>SPAN-SPAN,我的孩子被附加到最后一个SPAN中。@AdamWhite如果你有JS控件,你可以在这些SPAN周围附加元素