• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

Css Basic: marker-offset

December 20, 2023

CSS Basics: marker-offset

In CSS, the marker-offset property is used to specify the distance between the marker box and the principal box in a list item. It allows you to control the positioning of the marker relative to the content of the list item.

Understanding marker-offset

When you create a list using HTML, each list item is typically preceded by a marker, such as a bullet point or a number. The marker-offset property allows you to adjust the position of this marker.

The marker-offset property takes a length value, which can be specified in pixels, percentages, or other CSS units. A positive value moves the marker away from the content, while a negative value brings it closer.

It’s important to note that the marker-offset property only applies to list items that have a display value of list-item. It does not affect other elements or pseudo-elements.

Examples

Let’s take a look at some examples to understand how the marker-offset property works:

<style>
  ul {
    list-style-type: square;
  }

  li {
    marker-offset: 10px;
  }
</style>

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

In this example, the marker offset is set to 10 pixels. As a result, the marker box for each list item will be positioned 10 pixels away from the content.

Here’s another example:

<style>
  ol {
    list-style-type: decimal;
  }

  li {
    marker-offset: -5px;
  }
</style>

<ol>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

In this case, the marker offset is set to -5 pixels. As a result, the marker box for each list item will be positioned 5 pixels closer to the content.

Conclusion

The marker-offset property in CSS allows you to control the positioning of the marker in a list item. By adjusting the distance between the marker box and the content, you can customize the appearance of your lists.

For more information on CSS and VPS hosting solutions, visit Server.HK.

Recent Posts

  • How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  • CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  • Top 5 Use Cases for a Hong Kong Dedicated Server in 2026
  • Hong Kong VPS vs Japan VPS: Head-to-Head for Asia-Pacific Deployments in 2026
  • Hong Kong VPS vs Singapore VPS: Which Is Better for Your Asia Business in 2026?

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot