开发者

Behave like <ul><ol>

Just want to ask if its possible for a normal sentence with a number beside it behave like a <ul><ol> without even using <ul><ol>?

Below is the sample code:

<td>6. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel est
tortor. In hac habitasse platea dictums开发者_JAVA百科t. Nulla ut sem neque. Suspendisse
vulputate massa nec odio laoreet dignissim. </td>

The Below hows it supposed to be:

Behave like <ul><ol>

Thanks in advance! :)


Yes, you can do that, but you would need extra markup, and you would have to number items manually. But why would you want that?

For example (sorry, with inline css :)):

<td style="padding-left:20px;position:relative;">
   <span style="position:absolute;left:0;top:0;">1.</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel est tortor. In hac habitasse platea dictumst. Nulla ut sem neque. Suspendisse vulputate massa nec odio laoreet dignissim.
</td>

It could be done with pure css.


I strongly suggest you use the right markup to indicate the right structure of your content. If you cannot do it, you can alternatively apply list-style and other <ol> CSSes to <td>s. The hard coded numbers however should be wrapped in <span> and set to display: none to avoid repletion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜