我试图让io2012
中的第二个(较低)级子弹点与其父子弹点分开制作动画,如下所示:
>* First level animates by itself
>+ Second level then animates by itself
>* Another first level animates by itself
我尝试过使用HTML的几种解决方法,例如使用>*
代替>+
,同时尝试使用<div style="padding-left: 1em">>* Second level animated by itself
缩进项目符号。
然而,这只是缩进文本而不是项目符号。我对<li style="padding-left: 1em">...</li>
的实验同样失败了。
如果没有HTML解决方案,解决方案是否涉及CSS或JavaScript?
答案 0 :(得分:4)
如果你愿意采用一种稍微粗暴的解决方法,我已经成功地在我想要动画的段落和项目符号的开头插入.fragment
(我的幻灯片的其他一些内容与{{{ 1}}捷径,虽然我还没弄明白什么)。
无论如何,这应该有效,即使它有点笨拙。
>-
(- .fragment First level animates by itself
- .fragment Second level then animates by itself
- .fragment Another first level animates by itself
将div类“片段”添加到以下段落或项目中
答案 1 :(得分:2)
如果你想要一个子级别菜单递增,你可以在css中设置一个反增量,如下面的代码片段所示:
ol {
counter-reset: item
}
li {
display: block;
}
li:before {
content: counters(item, ".")" ";
counter-increment: item
}
<ol>
<li>one</li>
<li>two
<ol>
<li>two.one</li>
<li>two.two</li>
<li>two.three</li>
</ol>
</li>
<li>three
<ol>
<li>three.one</li>
<li>three.two</li>
<ol>
<li>three.two.one</li>
<li>three.two.two</li>
</ol>
</ol>
</li>
<li>four</li>
</ol>
但是,如果数字列表不是您的想法,可以通过多种方式使用各种列表样式类型来增加列表
h2.title {
font-size: 20px;
font-weight: 800;
margin-left:-20px;
padding: 12px;
counter-increment: ordem;
}
li.heading {
font-size: 16px;
font-weight: bold;
padding: 12px;
list-style-type:none;
}
.bullet {
counter-reset: bullet;
padding-left: 12px;
}
.bullet li {
list-style-type: none;
}
.bullet li:before {
counter-increment: bullet;
content: counter(ordem)"." counter(bullet)" ";
}
ol.none {
list-style:none!important
}
li.s2sub::before {
counter-increment:none!important;
content:none!important;
}
li.s2sub {
list-style:upper-alpha;
}
li.s3sub::before {
counter-increment:none!important;
content:none!important;
}
li.s3sub {
list-style-type:circle;
}
li.roman::before {
counter-increment:none!important;
content:none!important;
}
li.roman {
list-style:lower-roman inside;
}
<body>
<ol>
<h2 class="title">Section 1</h2>
<li class="heading">Heading 1</li>
<ol class="bullet">
<li>text 1 one</li>
<li>text 1 two</li>
<li>text 1 three</li>
<li>text 1 four</li>
</ol>
<li class="heading">Heading 2</li>
<ol class="bullet">
<li class="roman">Item 1</li>
<li class="roman">Item 2</li>
<li class="roman">Item 3</li>
</ol>
<h2 class="title">Section 2</h2>
<ol class="bullet">
<li>First item
<ol>
<li class="s2sub">First subitem</li>
<li class="s2sub">Second subitem</li>
</ol>
</li>
<li>Second Item</li>
<li>Third Item</li>
</ol>
<h2 class="title">Section 3</h2>
<ol class="bullet">
<li>First item
<ol>
<li class="s3sub">First subitem</li>
<li class="s3sub">Second subitem</li>
</ol>
</li>
<li>Second item</li>
<li>Third item</li>
</ol>
</ol>
</body>
希望这有帮助