Posted in CSS
2156
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
67
This Month
262
This Year
281

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
There is no way to happiness. Happiness is the way.
Unknown
Random CSS Property

scroll-padding-inline-end

The scroll-padding-inline-end property defines offsets for the end edge in the inline dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or to put more breathing room between a targeted element and the edges of the scrollport.
scroll-padding-inline-end css reference