View Single Post
Old 03-11-2025, 10:58 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,360
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
The W3Schools example in Karellen’s post lets you change the color of an html bullet, but you can also use images like so:

Code:
li::before {
  content: "•"; /* Insert content that looks like bullets */
  padding-right: 8px;
  color: blue; /* Or a color you prefer */
}


li::before {
  content: "url(../Images/bullet.png)";
  padding-right: 8px;}
As mentioned before, make sure you test on your target market’s devices/apps. Some of the more ancient devices may not support the pseudo-element ::before and you may need to provide fallback coding to cover those cases.

Also, make sure you pick a good image that works with different devices… eg. some may not look so good if it is a simple black image when the user selects night mode… you may not be able to see the bullet!!

Cheers!


EDIT:
Serves me right for trying to respond after a 12-hr work day from my phone...without testing...

Here is the code I should have posted

Code:
li::before {
  content: "";
  width:1em; height:1em;
  display: inline-block;
  background-image: url("../Images/bullet.svg");
  background-repeat:no-repeat;
  background-size:contain; 
}
Putting the image into the content line (with the quotes inside the parenthesis) works, but you can't adjust the size of the image - it is static.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-03-12 101856.png
Views:	74
Size:	168.3 KB
ID:	214291  

Last edited by Turtle91; 03-12-2025 at 10:30 AM.
Turtle91 is offline   Reply With Quote