我正在尝试使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?
如果你愿意使用一个稍微有点麻烦的解决方法,我已经成功地在我想要动画化的段落和项目符号的开头插入了.fragment
(我的幻灯片中的一些其他内容与>-
快捷方式相冲突,尽管我仍然不知道是什么)。
无论如何,这应该是可行的,即使它有点笨拙。
- .fragment First level animates by itself
- .fragment Second level then animates by itself
- .fragment Another first level animates by itself
(.fragment
将div类"fragment"添加到以下段落或项目中)
如果您希望子级菜单递增,您可以在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>
希望这能帮助