On Sep 22, 2011, at 10:38 AM, Giles, Sarah wrote:

> I want to add an img before a <div> tag using CSS content. Is this possible?
> 
> Before I get my rear jumped about adding content with CSS and the whole 
> separation of presentation and content thing I will state this img IS 
> presentation.
> Basically I have a grouping of <div> (<section> might be a more applicable 
> tag and I might think about switching them but they are edited by a person 
> whom isn't all that up to date with latest html and css)
> Some of these groups are "Special" And their specialness changes on a 
> personal whim. So I am creating a class to denote their specialness that will 
> change their background color, give a boarder, and change font color. I also 
> want to add a darling little img of a red ribbon to the corner of each 
> because you know nothing says I'm special like being decked out in ribbons 
> and bows.
> Now I just need to figure out how to add some kittens, unicorns and rainbows.
> hummm maybe I should use the :after selector to add an img of a kitten riding 
> a unicorn under a rainbow
> ….AND put the whole thing in a <blink> tag
> 
> Seriously though I want to keep the red ribbon out of my markup.
> 
> -Sarah

-Sarah:

I'm not sure as to what you want -- but markup is html and html is the language 
holds the entire web page together -- it's the glue. Images are just another 
item you can place within your markup and thus cannot be kept out of markup -- 
unless you do not use markup at all and just provide a url to an image. But I 
don't think that is what you want.

I won't address the concept of "separation of content from presentation" but 
basically it involves of first determining what is content and then second what 
is available to you do to change it's presentation. To me, if the presentation 
of an item can be changed, then the item is probably content. As such, CSS 
cannot add content, but rather simply change the way content can look.

Now, to answer your question of "is it possible to add an image before a div 
tag?" Most certainly -- I am sure you have seen image backgrounds, right? So, 
you can add images via css to appear anywhere you want.

One can argue that if css can provide an image, then it is providing content, 
but that's a weak argument.

So, what is it you really want to do? Providing urls of your attempts would 
help.

Cheers,

tedd

____________________
[email protected]
http://sperling.com





______________________________________________________________________
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/

Reply via email to