i'm making a site which is using css and i wanted to use links on my pages to other sites. the links section is there already on the page and default links in them. but is there a way i can add this to the css so i can easily edit the links on the style sheet without having to go through every page and edit them seperatly?
add this between the <head> tags on the pages... <link href="styles.css" rel="stylesheet" type="text/css" /> and then style them appropriately in the external stylesheet.
Im not sure if CSS is what you need here. Are you wanting to change the way the links appear or change the actual links themsleves? CSS would be useful to change the appearance, but not the links themselves. If that is what you need then you may want to use a php include for that. Are your pages using .php extension?
The way to style all links is as follows: a:link, a:active { /* styles for links in their default states */ } a:hover, a:focus { /* hover styles for links */ } a:visited { /* styles for links that have already been visited */ } Code (markup): If you don't want to change all links you will have to make these styles a bit more specific, for example identify the div the links are in (lets say it's in a div with a class of "links"): .links a:link, .links a:active { /* etc */ } Code (markup):
aye its to change the actual links themselves. my pages are .htm, not .php. i looked for a free javascript that would easily change the links for me, but the only scripts i can find are for banner rotation. so i thought i might be able to do it in the css.
You need to do this server side, not on the client (javascript). Use server side includes. All server side languages support an include method, as do web servers. Google is your friend. cheers, gary
yeah gary's right for what you need. CSS is purely presentational... it is used to style existing elements within the html. What you need are server side includes. If you change your file types to php or shtml you can just add this in the page <? include('links.html'); ?> Code (markup): and store the links in links.html.
I dont know of any way to use server side includes in html files. I am sure that you would not want to change all your html files to php as this could wreck havoc with your SERPs.
then just place this code in your httpd.conf file: AddType application/x-httpd-php .php .html Code (markup): and then use a 301 redirect to redirect from the .html files to the .php files by adding this to the .htaccess file in the root of your site RedirectMatch 301 ^/(.*)\.html$ http://www.yourdomain.com/$1.php Code (markup): All this does is tells apache to parse all .html files as .php files so there is no need to change your extensions on the actual files and your serp rankings wont be affected at all either