On 22.09.2011 16:38, Giles, Sarah wrote:
I want to add an img before a<div> tag using CSS content. Is this possible?
Yes, no problem.
Example-page: http://www.gunlaug.com/index.html
...where I use the following site-wide styles to insert 3 birds, an (R)
and a (C) in the header-area, and a cat at the cross-point between right
column and footer. All images absolute positioned relative to their
containers, and all discretely injected as page-decoration :-)
#nav:before {content: url(../imagedepot/burp-1.png);
position: absolute; top: -60px; right: 13%;
width: 150px;}
#base:after {content: url(../imagedepot/op-peregrine.png);
position: absolute; top: 54px; right: 8px;}
#sec:before {content: url(../imagedepot/op-peregrine-1.png);
position: absolute; top: -60px; left: -10%;}
#base:before {content: url(../imagedepot/op-kestrel-1.png);
position: absolute; top: -3px; right: 12%;}
#main:before {content: url(../imagedepot/cr20.png);
position: absolute; top: 103px; right: 3px;}
#main:after {content: url(../imagedepot/rg20.png);
position: absolute; top: 3px; left:330px;}
I have used the old form with ":" (not "::") to make it work in as old
browsers as possible, and even older browsers that don't support either
form just don't present the decoration.
regards
Georg
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/