During my lecture today, I talked about the display mode of tags in html, which are roughly divided into block-level tags and in-line tags. Then when beginners first use tags, they will find that some attributes do not work on some tags, such as width, height, and horizontal. In fact, the use of this attribute can only work on block-level tags. I personally think this is also a very easy place for beginners to ignore, so I will write it down!
For example, there will be a situation where the horizontal centering of the p tag is effective, but adding the horizontal centering attribute to the font is useless (as follows):
XML/HTML Code Copy content to clipboard