skip to Main Content

I want to decrease the padding of my ul, right now it’s 40 (I think). This code works to make the padding zero:

ul {
padding: 0;
list-style-type: none;

}

Using this code above works but it can only be 0 when I try something like 10 or 20 it doesnt work anymore. When I inspect the element I want to change it says the padding is 40 right now.

2

Answers


  1. Since you have not shown any HTML markup, nor CSS classes/Style sheets. Try to resolve the conflict in the CSS itself, or append !important to any size value present.

    ul.someClass {
        padding:10px !important;
        list-style-type:none;
    }
    

    And, it is reccommended to add a classname to the element itself, instead of assigning it to the whole ul element.

    Login or Signup to reply.
  2. Anything other than "0" add px (for example).
    If you just add 10, it does not know if that is 10px, 10em, etc.

    ul {
    padding: 10px;
    list-style-type: none;
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search