Inline CSS formatting best practices - Two questions

后端 未结 4 1973
遥遥无期
遥遥无期 2020-12-08 07:28

Question #1 - When specifying an inline style in an HTML element, is it necessary to include a trailing semi-colon? For example ...

4条回答
  •  死守一世寂寞
    2020-12-08 07:46

    Q1: No, but I always include a trailing semicolon. Some years ago that semicolon could be a reason to a wrong render (or lack of) by some browsers. I guess nowadays is not a problem.

    Q2: No, both ways means the same. Your election to include an space after the colon should be based on personal preferences for legibility.

提交回复
热议问题