简体   繁体   中英

Change size of Bullet Images in CSS

图片太大,无法成为子弹

that's the code

list-style-image:  url("https://www.boylesoftware.com/blog/wp-content/uploads/2015/04/checkmark.png") ;

I was expecting it be of small size like that of a actual bullet but it turned out too big

You can fix that problem applying the below style:

 li { margin: 0; padding: 0 0 0 20px; list-style: none; background-image: url("https://www.boylesoftware.com/blog/wp-content/uploads/2015/04/checkmark.png"); background-repeat: no-repeat; background-position: left center; background-size: 15px; }
 <h1>The list-style-image Property</h1> <p>The list-style-image property replaces the list-item marker with an image:</p> <ul> <li>Coffee</li> <li>Tea</li> <li>Coca Cola</li> </ul>

 <style>.check{ width: 25px; height: 25px; } </style> <p>Unordered List <img class="check" src="https://www.boylesoftware.com/blog/wp-content/uploads/2015/04/checkmark.png" alt="Alternate Text" /><a href="#">Step 1</a></p>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM