Posted in CSS
2133
11:33 pm, February 14, 2022
 

Using Marker to add a Triangle to List Items

In this demo i use the ::marker attribute on the list items to change the content of the marker to a ▶

HTML

<ul class="triangle-list">
  <li>List Item 1</li>
  <li>List Item 2</li>
  <li>List Item 3</li>  
</ul>

CSS

ul.triangle-list {
  margin: 0.75em 0;
  padding: 0 1em;
  list-style: none;
}
ul.triangle-list li::marker {
  content: "▶ ";
}
  • List Item 1
  • List Item 2
  • List Item 3

View Statistics
This Week
55
This Month
239
This Year
258

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote

“Make no mistake: This is not your diary. You are not letting it all hang out. You are picking and choosing every single word.”


Dani Shapiro
Random CSS Property

justify-content

The CSS justify-content property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container.
justify-content css reference