Why does HTML5 recommend putting the code element inside pre?

前端 未结 4 929
夕颜
夕颜 2020-12-04 14:27

The HTML5 documentation recommends putting the code element inside the pre element, but I don\'t understand how this is better or more semantic tha

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 14:43

     shows line breaks! 

    This prevent you using php function such as nl2br() or adding manually
    at every line end.

    Regards, Ghost

提交回复
热议问题