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

WBOY
WBOY 转载
2023-08-31 16:49:06 505浏览

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

在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 属性设置标记框与主框最近边缘之间的距离。

以上就是哪个属性指定标记框和主框最近边框边缘之间的距离?的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除