The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Is html:before allowed? Re: Is html:before allowed?


@Fourize That would work, and was my backup plan, but the idea was to reduce the number of non-semantic elements as much as possible.

Although I haven’t tried what your saying, it seems to me that the problem I was having was related to positioning/sizing my pseudo elements. Pseudo elements should work on any element…

What I ended up doing is add a wrapper div and centering the wrapper instead of body. Then I was able to use this same technique using body:before and body:after without any problems. It just seems like doing anything “fancy” to html is too much of an edge case, and asking for bugs.