哪个属性指定标记框和主框的最近边界边缘之间的距离?
在 CSS 中,‘marker-offset’ CSS 属性用于指定标记框和主框最近的边框边缘之间的距离。在 CSS 中,标记是一个伪元素,它指的是列表中的项目符号。
在这里,我们将学习设置标记框和主框最近的边框边缘之间的距离。
语法
用户可以遵循以下语法来设置标记框和主框最近的边框边缘之间的距离。
marker-offset: value;
示例
在下面的示例中,我们创建了一个包含不同编程语言的无序列表。此外,我们还使用了 ‘marker-offset’ CSS 属性来设置标记框和主框最近的边缘之间的距离。
<html>
<head>
<style>
.list {
marker-offset: 2em;
}
</style>
</head>
<body>
<h3> Using the <i> marker-offset CSS property </i> to specifies the distance between nearest border edges of marker box and principal box in CSS </h3>
<ul class = "list">
<li> JavaScript </li>
<li> HTML </li>
<li> CSS </li>
<li> C </li>
<li> CPP </li>
</ul>
</body>
</html>
示例
在此示例中,我们对有序列表使用了 ‘marker-offset’ CSS 属性。我们应用了 ‘2cm’ 的偏移量,它表示 2 厘米。
<html>
<head>
<style>
.list {
marker-offset: 2cm;
}
</style>
</head>
<body>
<h3> Using the <i> marker-offset CSS property </i> to specifies the distance between nearest border edges of marker box and principal box in CSS </h3>
<ol class = "list">
<li> English </li>
<li> Hindi </li>
<li> Gujarati </li>
<li> Marathi </li>
<li> Urdu </li>
</ol>
</body>
</html>
用户学会了使用 ‘marker-offset’ CSS 属性来设置标记框和主框最近的边缘之间的距离。
广告
数据结构
联网
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP