Indent List in HTML and CSS

后端 未结 7 1579
抹茶落季
抹茶落季 2021-02-05 04:17

I\'m new to CSS and working with list. I tried using one of the code I saw on w3schools which shows how to indent lists:




A n

7条回答
  •  南旧
    南旧 (楼主)
    2021-02-05 05:07

    You can use [Adjacent sibling combinators] as described in the W3 CSS Selectors Recommendation1 So you can use a + sign (or even a ~ tilde) apply a padding to the nested ul tag, as you described in your question and you'll get the result you need. I also think what you want it to override the main css, locally. You can do this:

    
    

    This way the inner ul will be nested including the bullets of the li elements. I wish this was helpful! =)

提交回复
热议问题