哪个属性指定标记框和主框最近边框边缘之间的距离?

cssweb developmentfront end technology更新于 2024/4/18 5:00:17

在 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>

示例

在本例中,我们在有序列表中使用了 CSS 属性 'marker-offset'。我们应用了偏移量 '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 属性设置标记框和主框的最近边缘之间的距离。


相关文章


有用资源