Which unit I should use in CSS when designing a web page

后端 未结 6 1570
臣服心动
臣服心动 2020-12-05 10:49

I have designed and developed more than 10 sites, but I still have a doubt about the correct unit I should use. Should it be px, em or %

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 11:39

    For flexibility and accessibility I recommend using % for horizontal measures (relative to the user's screen), and em for vertical measures (relative to the user's font setting).

提交回复
热议问题