Solved

Cascading Style Sheet and footer HTML

Posted on 2009-04-02
14
382 Views
Last Modified: 2012-05-06
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 -





0
Comment
Question by:SteptoeTeam
14 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
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
 
LVL 2

Accepted Solution

by:
thunderwonder earned 500 total points
Comment Utility
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
 

Author Comment

by:SteptoeTeam
Comment Utility
How would I implement a server side include - considering that
I have to maintain this every year
0
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
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
 

Author Comment

by:SteptoeTeam
Comment Utility
Using IIS and is static htnl.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
Okay, so use the Library Item advice.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:SteptoeTeam
Comment Utility

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

Expert Comment

by:Jason C. Levine
Comment Utility
>> 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
 

Author Comment

by:SteptoeTeam
Comment Utility

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

Author Comment

by:SteptoeTeam
Comment Utility

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
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
Please do.  One question per thread is the rule here.
0
 

Author Comment

by:SteptoeTeam
Comment Utility

No points will be added for the 301 redirect question
0
 
LVL 13

Expert Comment

by:qwerty021600
Comment Utility
Else you can Manage Site in DW, which will help in replacing code in one go in all the pages.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now