Why does CSS work with fake elements?

前端 未结 19 744
野的像风
野的像风 2020-11-28 01:21

In my class, I was playing around and found out that CSS works with made-up elements.

Example:

19条回答
  •  借酒劲吻你
    2020-11-28 01:50

    Why doesn't he want you to use them? They are not common nor part of the HTML5 standard. Technically, they are not allowed. They are a hack.

    I like them myself, though. You may be interested in XHTML5. It allows you to define your own tags and use them as part of the standard.

    Also, as others have pointed out, they are invalid and thus not portable.

    Why didn't he know that they exist? I don't know, except that they are not common. Possibly he was just not aware that you could.

提交回复
热议问题