简体   繁体   English

表现得像<ul><ol>

[英]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> ? 只想问,如果可能的正常语句与多家它旁边像一个<ul><ol>甚至不需要使用<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 dictumst. Nulla ut sem neque. Suspendisse
vulputate massa nec odio laoreet dignissim. </td>

The Below hows it supposed to be: 下面是怎么回事:

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 :)): 例如(很抱歉,内联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. 可以使用纯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. 如果您不能这样做,则可以将list-style CSS和其他<ol> CSS应用于<td> The hard coded numbers however should be wrapped in <span> and set to display: none to avoid repletion. 但是,硬编码的数字应包装在<span>并设置为display: none以避免重复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM