Posted in CSS
2076
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
75
This Month
273
This Year
201

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


Me
Random CSS Property

rotate3d()

The rotate3d() CSS function defines a transformation that rotates an element around a fixed axis in 3D space, without deforming it. Its result is a <transform-function> data type.
rotate3d() css reference