A developer is tasked with creating a navigation menu where each list item has a custom icon instead of the default marker. How can they achieve this using CSS properties related to list styles?

  • list-style-type: none; background-image: url('icon.png'); background-size: 20px 20px; background-repeat: no-repeat; padding-left: 30px;
  • list-style-type: none; content: url('icon.png'); padding-left: 30px;
  • list-style: none; background-image: url('icon.png'); background-size: 20px 20px; background-repeat: no-repeat; padding-left: 30px;
  • list-style-type: none; background: url('icon.png') no-repeat left center; padding-left: 30px;
Option 4 is correct. It sets list-style-type to none and uses a background image for the custom icon, adjusting padding for spacing.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *