0

我正在尝试使用ol类型进行嵌套的有序列表,虽然代码在 Wordpress 预览中看起来正确,但当我在 Firefox 和 IE 中预览时它没有正确显示,列表都显示为编号列表而不是我指定的类型在代码中。我的代码如下。有人可以帮我找出问题所在吗?

提前感谢您的帮助!凯利

Teaching your kids about money isn't always child's play. But helping them make smart choices early will pay off later.
<span style="text-decoration: underline;">Baby Steps</span>
<h4>Even the cartoon set can learn the value of a dollar. Some simple ideas:</h4>
<ol class="alt1">
    <li>Show your toddler the various coins in your pocket or change purse and see if the clever tyke knows what each one can buy.
<ol type="a">
    <li>Gum machines or mechanical rides still take coins. Or try old-fashioned "penny candy" shops, even if that bubble gum goes for a dime now.</li>
    <li>How many coins are necessary to buy a popsicle or frozen yogurt at the ice cream truck?</li>
    <li>Field trip: checking the prices at the grocery store can be instructive for kids —and their parents, too!</li>
</ol>
<ol class="alt2">
<ol type="i">
    <li>Where does money come from (besides the ATM machine)? Discuss getting paid for work and how your salary lets you buy things for the family.</li>
    <li>Lemonade stands still do a thriving business for first-time entrepreneurs.</li>
    <li>Old toys can be contributed to Mom’s and Dad's yard sale to score a profit.</li>
    <li>Discuss the best way to invest the proceeds with your tiny mogul. Hint: don't blow it all on candy or games.</li>
</ol>
</ol>
Older kids can understand the difference between necessary and optional purchases. Milk or gummi bears?
<h2>Here's Your Allowance</h2>
<h4>Yep, it's still a great teaching tool after all these years. Some ways to get with the program:</h4>
<ol class="alt1">
    <li>Doling out the cash on a weekly basis makes sense. Even older kids may find it tough to budget a month in advance.</li>
    <li>Decide whether there will be strings tied to the stipend. Will Junior have to complete household chores before you fork over the cash?</li>
</ol>
<ol class="alt1">
<ol type="a">
    <li>Some families think helping around the house should be expected and unrelated to the weekly payout.</li>
    <li>Other parents think it's a good way to introduce the idea of working for money and getting paid for a job well done.</li>
</ol>
</ol>
<ol>
    <li value="3">In coming up with a dollar amount, savvy parents will not fall for reports of what the other parents are shelling out. Multiplying your own allowance in the distant past by the rate of inflation may be a good starting point.</li>
</ol>
</li>
</ol>
4

2 回答 2

1

要将一个列表嵌套在另一个列表中,您必须将其放置在 <li> 元素中。您不能将其直接放在 <ol> 元素中。

换句话说,替换这个:

<ol>
<ol>
...
</ol>
</ol>

有了这个:

<ol>
<li>
<ol>
...
</ol>
</li>
</ol>
于 2013-10-21T21:37:03.530 回答
0

我测试了非 wordpress html 页面和 wordpress 条目。我的猜测是 wordpess 正在剥离您的类型标签,因此请尝试使用 CSS。给每个 <li> 一个类,并为您的 css 使用list-style-type来声明列表项标记类型。

即:
ol.lower-alpha {list-style-type:lower-alpha}
li.lower-latin {list-style-type:lower-latin}

于 2013-10-21T21:52:23.207 回答