Forum Moderators: not2easy

Message Too Old, No Replies

Display message after H4 tags

using classes

         

limbo

3:34 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a section of an Intranet site that is going to be archived. That in itself is a big piece of work but I need to label all the H4's with the word "Archive". Is there a way to display this using CSS to add this to the content? I thought about using Find and replace but that'd do them all and 50% of the site will remain unarchived.

Ta

Limbo

drbrain

3:45 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes and no.

You can use the :after selector to append content to any element:

h4:after { content: " Archive" }

But this only works with modern browsers (not IE).

Furthermore, SEs will not see content added via CSS like this.

limbo

4:00 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Doc

Guess what - all our Intranet users use the same browser - bet you can't guess what it is ;)

Not worried about SE's our SE uses meta.

Is there a way I could diplay it as an image?

something like: (excuse the loose garbage css terms)

H4 {
display: image(archive.gif)
position: follow
....

or something like that?

drbrain

5:46 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



h4:after {
content: url(archive.png);
}

benihana

5:52 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



would being able to overlay the h4 on an image background help?

if so you coulddo something like:

#whatever h4 {
width: 200px;
height:200px;
background:url(myimage.gif) no-repeat bottom left;
vertical-align:top;
}

then maybe have your height a little greater than the image so the h4 sits above it.

just a theory.

good luck
ben

SuzyUK

6:44 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



limbo would giving the archived pages a body ID or class work

i.e.
<body id="archived">

then without changing any HTML you can then specifically target the <h4>'s on archived pages and give them a different background image or something? (with the background image containing the text you want to display..)

#archived h4 {different style rules from normal <h4's> here}

Suzy

limbo

9:14 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks all.

Plenty of food for thought there. I will give it a shot int' morning.

Ta

Limbo

limbo

11:21 am on Jun 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SuzyUK

I went with your option. And it worked a treat. Split the site in two(DW) applied a find and replace on one set of files and then merged the site again and refreshed Cache.

Now I can 'please and thankyou' on any tag on the archived section.

Perfect.

Ta

Liam