Which property specifies the distance between nearest border edges of marker box and principal box?


In CSS, the ‘marker-offset’ CSS property is used to specify the distance between the nearest border edges of marker box and principal box. In CSS, the marker is a pseudoelement that refers to the bullet points of the lists.

Here, we will learn to set the distance between the nearest border edges of marker box and principal box.

Syntax

Users can follow the syntax below to set the distance between the nearest border edges of the marker box and the principle box.

marker-offset: value;

Example

In the example below, we have created an unordered list of different programming languages. Also, we have used the ‘marker-offset’ CSS property to set the distance between the nearest edges of the marker box and the principle box.

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

Example

In this example, we have used the ‘marker-offset’ CSS property with the ordered list. We have applied an offset of ‘2cm’, which represents the 2 centimetres.

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

Users learned to set the distance between the nearest edges of the marker box and the principle box using ‘marker-offset’ CSS properties.

Updated on: 19-Apr-2023

165 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements