如何在列表中插入图片作为项目符号
How to insert picture as your bullet in a list
我目前正在 HTML 中的 table 中创建列表,我知道要创建项目符号,我必须使用以下语法。
<li><p>The table element was not designed to be a layout tool. </p></li>
<li><p>The table element is a layout tool. </p></li>
下面的代码会有如下所示的输出显示:
The table element was not designed to be a layout tool.
The table element is a layout tool.
但是,我可以将项目符号更改为自定义图像吗?如果可能的话,我该怎么做?
可以,使用 list-style-image
:
ul {
list-style-image: url('path/to/your/image');
}
我目前正在 HTML 中的 table 中创建列表,我知道要创建项目符号,我必须使用以下语法。
<li><p>The table element was not designed to be a layout tool. </p></li>
<li><p>The table element is a layout tool. </p></li>
下面的代码会有如下所示的输出显示:
The table element was not designed to be a layout tool.
The table element is a layout tool.
但是,我可以将项目符号更改为自定义图像吗?如果可能的话,我该怎么做?
可以,使用 list-style-image
:
ul {
list-style-image: url('path/to/your/image');
}