带有说明的HTML文本列表

时间:2018-04-19 07:00:56

标签: html list text

我想提供一个带有解释的基本文本列表。 查看截图(这是在文本编辑器中完成的。)

我在想一个html表,但我不能轻易地模拟这个。 有什么建议吗?

enter image description here

我想使用 而不是 div ,因为这样可以让我轻松添加新线。大多数html编辑器只允许使用TAB添加新行。

问题是css:如何让线条彼此接近?

DIV示例(感谢Sylent):



.divClass {
  display: table-row;
}

.divClass div {
  padding: 3px;
  display: table-cell;
}

<div class="divClass">
    <div>description</div>
    <div>Descriptive test with info.</div>
</div>
<div class="divClass">
    <div>description</div>
    <div>Descriptive test with info.</div>
</div>
&#13;
&#13;
&#13;

*表格示例:*

&#13;
&#13;
.divClass {
  display: table-row;
}

.divClass div {
  padding: 3px;
  display: table-cell;
}
&#13;
<table class="divClass">
    <tr>
        <td>definition</td>
        <td>Descriptive test with info.</td>
    </tr>
    <tr class="divClass">
        <td>definition</td>
        <td>Descriptive test with info.</td>
    </tr>
</table>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

使用<div>和一些CSS。

HTML:

<div class="divClass">
        <div>some text</div>
        <div>some text</div>
    </div>
    <div class="divClass">
        <div>some text</div>
        <div>some text</div>
    </div>

的CSS:

.divClass {
  display: table-row;
}

.divClass div {
  padding: 3px;
  display: table-cell;
}

希望这对你来说足够好:D。