css背景图像属性
描述 (Description)
This property specifies the image to use as a list marker for an item in a list (an element whose display property has the value list-item
). If the specified image is available, it will replace any marker specified by the list-style-type
property.
此属性指定用作列表中项目(其显示属性值为list-item
的元素)的列表标记的图像。 如果指定的图像可用,它将替换list-style-type
属性指定的任何标记。
The exact position of the list marker image can’t be specified beyond what the list-style-position
property allows.
超出list-style-position
属性所允许的范围时,无法指定列表标记图像的确切位置。
例 (Example)
This style rule assigns an image as the list marker for all items in the list with ID "links"
:
此样式规则为ID为"links"
的列表中的所有项目分配一个图像作为列表标记:
#links li {
list-style-image:
➥ url("/images/link.png");
}
值 (Value)
If the property value is specified as none, no list marker image will be used. Instead, the list-style-type
property will control what type of list marker—if any—will be rendered.
如果属性值指定为none,则将不使用列表标记图像。 相反, list-style-type
属性将控制将呈现哪种类型的列表标记(如果有)。
If the value is specified as a URI using the url() functional notation, the image at that URI will be used as the list marker if it’s available.
如果使用url()功能符号将值指定为URI,则该URI上的图像将用作列表标记(如果可用)。
翻译自: https://www.sitepoint.com/list-style-image-css-property/
css背景图像属性