Forum Moderators: not2easy

Message Too Old, No Replies

using css to create a 'home' button

         

intron

9:03 pm on Sep 9, 2005 (gmt 0)

10+ Year Member



Hi,

I have been given approximately 100 html pages that we created as documentation to a program. I would like to add a simple navigational button at the bottom of the page (or the bottom of one of the dividers) and, obviously, would rather not hand code this in every page. All pages use one CSS. Is it possible to create a linking image within the css that would be displayed on every page. I have tried to use the 'background-image' property of a divider and can get a small image button positioned where i want it "background-position: right bottom" but I dont know of a way to assign a url to it (and I think there probably isnt one).

Can anyone think of a way to insert an image with a link using css?

Thanks,

Mark

collymellon

9:41 pm on Sep 9, 2005 (gmt 0)

10+ Year Member



intron if im not mistaken you cannot assign a link using CSS only it requires HTML. copy and paste the link into each page - 100pages, 5-10mins :)

moltar

10:04 pm on Sep 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You cannot change the content of HTML with CSS. You can only change it's appearence.

intron

12:53 am on Sep 10, 2005 (gmt 0)

10+ Year Member



poop. i didnt think it was possible but i figured it was worth a try to ask.

i guess i will get a copy/paste workout tonight.

thanks for the responses.

mark

hakre

1:23 am on Sep 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hmm, i know how to do it, but i will never tell you ;) hehe. nope, try using :before or :after pseudo classes. consult your css documentation you prefer and good luck!

createErrorMsg

2:31 am on Sep 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try using :before or :after pseudo classes

These are very poorly supported, and even when supported are not able to add chunks of html code, only strings of text or content objects (such as images). :before and :after [w3.org] would not work in this situation.

i guess i will get a copy/paste workout tonight.

An operation like this can be performed in a matter of seconds using a GREP tool or other find and replace software, many of which are available as free downloads. The tool I use allows you to specify directory(s) and will scour every file in it searching and replacing an indicated string, literally faster than it would take you to open a single file. Good stuff.

Also note that there are ways to set up a site to include content from one central location on any number of different pages via ServerSideIncludes (SSI) or PHP includes. Let us know if you're interested in reading about these topics and we can point you to some great threads in this and other WebmasterWorld forums that can get you started.

cEM