/    Sign up×
Community /Pin to ProfileBookmark

Copyright and CSS?

Hi, I’m trying to find a way to have a copyright on all of my pages. Since I have over 30+ pages it makes more sense to be able to edit this section from one file instead of editing all these 30+ pages. I’m wondering if there is a way to do this with CSS or would I need to use a language such as PHP instead?

Thanks

to post a comment
CSS

12 Comments(s)

Copy linkTweet thisAlerts:
@tracknutSep 20.2007 — If your copyright was an image file, then you could use CSS to put it on every page. But the more normal way is with server side includes, in PHP or other server languages.

Dave
Copy linkTweet thisAlerts:
@Major_PayneSep 20.2007 — For those who don't mind using JavaScript, there is a script that will always keep your copyright date correct once you've entered the starting date. Just requires the script to be called where you want it to run and must be listed on each page. Those few who have JS turned off, will not see the copyright notice.

You also can use one of these [B]banners[/B].

Ron
Copy linkTweet thisAlerts:
@codebudoSep 20.2007 — Technically you can do this with pure CSS, but not all browsers support it.

<i>
</i>h1:after
{
content: url('copy.html');
}




---
http://www.codebudo.com/
Copy linkTweet thisAlerts:
@angelic81authorSep 20.2007 — Thanks for the response guys.

If your copyright was an image file, then you could use CSS to put it on every page. But the more normal way is with server side includes, in PHP or other server languages.

Dave[/QUOTE]


tracknut, I'm interested in learning how to do this with images as well could you fill me in as to how the code would look like? Thanks.
Copy linkTweet thisAlerts:
@Major_PayneSep 20.2007 — Are you wanting the SSI code to do this or what?

Ron
Copy linkTweet thisAlerts:
@NogDogSep 20.2007 — Note that using a CSS background image would mean your copyright would not be seen in text-only browsers, text-to-speech readers, and (if it matters) robots and other programs that might read your web pages.

On my site all my pages are PHP-based and include a footer function that outputs the copyright notice and automatically makes the year range end in the current year.
Copy linkTweet thisAlerts:
@Major_PayneSep 20.2007 — Here's two quickies:

[CODE]Copyright &copy; 2004-<?php echo date('Y'); ?>[/CODE]

[CODE]<script type="text/javascript">
<!-- Begin
copyright=new Date();
update=copyright.getFullYear();
document.write("Copyright &copy; 2004-"+ update + " Zero Engineering All rights reserved.");
// End -->
</script>[/CODE]


Change as needed.

Ron
Copy linkTweet thisAlerts:
@BrettNooyenSep 20.2007 — Just be aware that if you use Javascript to grab the date it will pull the date of the visitor's computer, not the server, so it could be incorrect at times. However given your question the Javascript seems the best answer, if you want to stay away from SSI's.
Copy linkTweet thisAlerts:
@tracknutSep 20.2007 — tracknut, I'm interested in learning how to do this with images as well could you fill me in as to how the code would look like? Thanks.[/QUOTE]

Well I'm not at all recommending you do it this way, and the various other comments about why not to do it, or to JS are certainly applicable. But the thought would be to make a file called copyright.jpg, which had the text "(c) 2007 Angelic81" written on it. Then if you had in your HTML for each page:
<i>
</i>&lt;img src="copyright.jpg" alt="Copyright"&gt;


Then if you needed to update the copyright to 2008, you'd just change that image in one place.

It's cheezy, I'm almost sorry I mentioned it ?

Dave
Copy linkTweet thisAlerts:
@Major_PayneSep 24.2007 — Just be aware that if you use Javascript to grab the date it will pull the date of the visitor's computer, not the server, so it could be incorrect at times. However given your question the Javascript seems the best answer, if you want to stay away from SSI's.[/QUOTE]Since it only pulls the year for the update, there shouldn't be any problem unless they have their year that far off on the computer.

Ron
Copy linkTweet thisAlerts:
@BrettNooyenSep 24.2007 — Since it only pulls the year for the update, there shouldn't be any problem unless they have their year that far off on the computer.

Ron[/QUOTE]


I only mentioned it because it's not a good habit to get into, relying on the client computer vs server.
Copy linkTweet thisAlerts:
@TJ111Sep 24.2007 — Relying on client computer's for anything is risky business. While unlikely, the fact that the copyright is a legal item could cause issues if the computer date is incorrect. I know that before I discovered Open Office, I would set my computer date back a year so I could continue to use my trial versions of MS Office.
×

Success!

Help @angelic81 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...