Cascading Style Sheet and footer HTML

Hi

I would like to add text to the CSS footer - is this possible.  There is already a footer

At the moment each page has a footer already- ideally what I would like to do is add the footer text to the CSS so it will automatically update each html web page.  So when I need to change the footer I do it from the CSS -

The current CSS sheet is as follows:

#footer {
width:780px;
margin:0px auto;
clear:both
}

And the html web page is as follows:

<!-- Footer -->
<div id="footer">
<p>&copy; Test Footer 2007</p>
</div>

So I would like to add the above footer to the CSS and remove the footer from the html page -





SteptoeTeamAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
thunderwonderConnect With a Mentor Commented:
well, you can use CSS content property.

Like u can use this code to add 'I am green' before every paragraph in green class

.green p:before {
    content: 'I am green';
}


Refer:
http://www.w3.org/TR/CSS21/generate.html
http://htmldog.com/reference/cssproperties/content/
http://www.w3schools.com/Css/pr_gen_content.asp
0
 
Jason C. LevineNo oneCommented:
No, this is not possible.  CSS is meant to separate your design from the content.  It has no ability to be a templating system.

Since you are using Dreamweaver, you do have some ability to do this from the software.  You can make the footer a Library Item and that will allow you to do a single edit to update all pages.  You can do a sitewide Find and Replace to make the edit.  You could switch over to a DW template (not recommended).  Finally, you could create a server side include for the footer.

All of the above will allow for a single edit to maintain the footer.
0
 
SteptoeTeamAuthor Commented:
How would I implement a server side include - considering that
I have to maintain this every year
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
Jason C. LevineNo oneCommented:
Depends on the server and scripting available?  I assume Apache?  Is this a static HTML site or a PHP site?

If you are unsure, switch to the Library Item advice.  It's essentially the same thing as SSI just run from the DW framework.
0
 
SteptoeTeamAuthor Commented:
Using IIS and is static htnl.
0
 
Jason C. LevineNo oneCommented:
Okay, so use the Library Item advice.
0
 
SteptoeTeamAuthor Commented:

Ok let me try and revert.  Since we are on this topic can I use
301 redirect with htnl with no scripting.
0
 
Jason C. LevineNo oneCommented:
>> Since we are on this topic can I use 301 redirect with htnl with no scripting.

What does that have to do this topic?
0
 
SteptoeTeamAuthor Commented:

Ok let me try and revert.  Since we are on this topic can I use
301 redirect with htnl with no scripting.
0
 
SteptoeTeamAuthor Commented:

It doesn't but since I was asking about CSS I thought I
Would ask this as well.  I will post a new question for this -
0
 
Jason C. LevineNo oneCommented:
Please do.  One question per thread is the rule here.
0
 
SteptoeTeamAuthor Commented:

No points will be added for the 301 redirect question
0
 
qwerty021600Commented:
Else you can Manage Site in DW, which will help in replacing code in one go in all the pages.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.