I noticed that block elements (ex. div) have some kind of margins by default, and it seems I cannot reset them via css. So how to? does anyone know?
2条回答 默认 最新
- dqc2017 2018-08-16 07:16关注
Ok, further investigation took me to the following findings:
Basically, you cannot use other than really simple/direct selectors. No nested selectors are allowed (like
.class p
, orul li
), so:think ahead and structure your document in a really simple manner so you don't have to use nested selectors or something more complicated. For example, do not use nested lists (
ul li ul
)write your css all with ultra simple direct selectors (one element or one class)
then you can reset all the margins and paddings of block elements, if/when/where needed.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报