Layout: Using the Content option

started by Terakris on May 12, 2004 — RSS Feed

Terakris Terakris
Posts: 23

Hi,

My newest problem involves the content option.

I have a div in a page and at the start of this specific div i want to put a charactor, say "aaa". ive put the following code in place and it works in Netscape, Firefox & Opera but NOT IE!  >

#title:before {
 content: "aaa";
}

I already have #title set elsewhere in the style sheet so it uses both these to display.

Like i say, it works fine in the other browsers but not in IE - does anyone have a work around or spot somthing im doing wrong?

Thanks

Joe Gillespie Joe Gillespie
Posts: 528

'title' is a reserved word in HTML just like 'body', you can't use it as an id.

Terakris Terakris
Posts: 23

yeah thats a trimmed down version to save my typing the whole thing... its actually #home-title-blahblahblah { etc.

Joe Gillespie Joe Gillespie
Posts: 528

The the correct syntax would be...

#home.title:before {content: "aaa";}

but you are really asking for trouble using this pseudo-element in terms of browser support and things like indexing bots.

Terakris Terakris
Posts: 23

yeah, just found a doc on the net that says its not supported in IE at all... oh well, I'll put what i wanted into the database that will hold the home page content instead.

ta

You must login to reply