[thelist] CSS Hack? (was .css files vs inline CSS and .js vs inline JS?)
Sarah Sweeney
mr.sanders at designshift.com
Tue May 17 14:26:47 CDT 2005
>>> Embedded JS or CSS is always a hack and not clever.
>
> Really? I use a stylesheet to load a background image on all pages
> within a site, except for the home page. To over-ride that background
> image for that single page, I use an inline style of:
>
> body {
> background-color: #FFFFFF;
> background-image: none !important;
> }
>
> Is that truly a hack? Is there a more elegant way to do this?
Yup. Add id="home" to the body tag of your home page, then add this to
your main stylesheet:
body#home {
background-color: #FFFFFF;
background-image: none !important;
}
HTH
--
sarah sweeney
web developer & programmer
my portfolio: http://sarah.designshift.com
my blog: http://hardedge.ca
my family: http://geekjock.ca
More information about the thelist
mailing list