Unstoppable Domains

Adding Text with CSS?

Spaceship Spaceship
Watch
Impact
769
Hi all,

I was just wondering if it is possible to add text to all of your webpages using an external css.

For example, if I want to add a copyright notice (ie...copyright 2006) at the bottom of every page, what can I do?

I have a website built entirely of html pages, but I would like the ability to edit a single page instead of all of them.

Regards,
Steve
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
CSS is not for adding content to pages, it's used to stylize content within your HTML code. You can dynamically add content to all of your pages... one would be to use some sort of scripting language like PHP to create a page template and have your template included on all of your pages. For example, you would create a php file (say copyright.php) with the following:

Code:
<?php
echo "Copyright © 2006, ABC Company.";
?>

Then on all of your pages (assuming they're php files) you can simply include the copyright.php file. In your page's source you'd add the following where you want the copyright statement to appear:

Code:
<?php include('path/to/copyright.php'); ?>

This is just a basic solution to achieve this. You can get really advanced with PHP and templates. For example, on my website I have a template file (template.php) that includes two functions - getHeader() and getFooter() - which contain the HTML source for my header and footer. Then on any page I want to display, before my content I'd print the results of header function and after my content I'd print out the results of the footer function.

You can also do it using HTML includes... but to be honest, I don't remember that method since I haven't used that for over 10 years. PHP Templates are so much easier.
 
0
•••
CreedFeed is surely absolutely right, CSS is only used to stylize the layout of your contents.

as CreedFeed suggested switching your pages to use PHP would be a great idea
the method above is basically the easiest i could also think of.

you'll just have to change your .html pages to .php to start after that
you can easily create the above examples and include that on your pages
i'm sure your hosting provider supports php as it is the most popular and widely used language on the internet.

Just to let you know theres also a Apache / PHP variable that you can set in your configuration files (if you have the access to them) you can enter the locations of your include files and apache will automatically add those files for you in all your pages.

you can also edit the apache to httpd.conf file to setup php on your .html extensions
please let us know if you need further help

hope this helps
Regards,
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back