I am new to css and web design so please be gentle 😉
I was wondering if it is possible to define the background of a page (i.e. what color the screen is) without referring to the tag. So not doing the typical:
body { background-color: #fff; }
I need to do this since I am writing css to stylize our login page, but only have access to the template html to be inserted into the page body. So my html looks something like this (very simplified):
<div id="loginpage">
<div id="title"/>
<div id="content"/>
</div>
I couldn’t find any answers online since this seems to be an unusual way of doing it.
So: Is this possible, if yes – how?
You can use the
:rootselector if you don’t mind about losing IE6-8 support.But have you tried targeting
bodyorhtml, in spite of the fact that they’re not in the code? They still get inserted into the DOM.