« Random images | Main | Johnny Depp? »
July 12, 2005
How to: Transparencies in webpages
This wiser effort would have been, to diffuse thought and imagination through the opaque substance of to-day, and thus make it a bright transparency...Nathaniel Hawthorne, The Scarlet Letter
As some have noted, I like transparencies in web pages. Quite possibly too much, as all my pages appear to have them, from Layil to the Time of Darkness Bugtracker and this blog.
This is not purely for Movable Type, it can easily be added to any page that uses stylesheets. If you're not comfortable editing stylesheets, this is not a complex project. Honest.
Inside the stylesheet, usually right at the top, there is a body tag, which will look somewhat like this:
body {
margin: 0px 0px 20px 0px;
background-color: #8FABBE;
text-align: center;
}
This is a simple body tag, taken from the default Gettysburg CSS, offered by SixApart. Yours may be more complex.
To this is added a background image (so you actaully see the opacity setting work), and the opacity settings themselves.
background-image: url(http://www.layil.org/images/MTBackgrounds/rotator.php);
background-repeat: no-repeat ;
background-position: bottom left ;
background-attachment: fixed;
filter: Alpha(Opacity=75);
-moz-opacity: .75;
The background image and it's position are set (fixed on the lower left so it won't scroll, does not reapeat the image to fill up the screen) and, more importantly, where the (two) opacity filters are configured. These two values are the more or less the same thing, they simply target different browsers so that it should work with IE and Firefox/Mozilla. Safari does not work with these. May I suggest using Firefox or Camino instead?
Increasing the number will make it less transparent, lowering it will make it more so. I find 75 (and .75) pleasant, your mileage may vary.
Combining them, the result is:
body {
margin: 0px 0px 20px 0px;
background-color: #8FABBE;
text-align: center;
background-image: url(http://www.layil.org/images/MTBackgrounds/rotator.php);
background-repeat: no-repeat ;
background-position: bottom left ;
background-attachment: fixed;
filter: Alpha(Opacity=75);
-moz-opacity: .75;
}
After saving and rebuilding the stylesheet, you now have a page that you can see through.
Scrawled illegibly by Meathe at July 12, 2005 12:41 PM
Comments