Why does CSS work with fake elements?

前端 未结 19 732
野的像风
野的像风 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:54

    Why does CSS work with fake elements? Because it doesn't hurt anyone because you're not supposed to use them anyways.

    Why doesn't my professor want me to use made-up elements? Because if that element is defined by a specification in the future your element will have an unpredictable behavior.

    Also, why didn't he know that made-up elements exist and work with CSS. Are they uncommon? Because he, like most other web developers, understand that we shouldn't use things that might break randomly in the future.

提交回复
热议问题