It is currently Fri Apr 27, 2018 2:12 am


CSS help

Help with Web Design, Programming, and Graphics

Moderator: Gecko

CSS help

Postby cking » Thu Mar 06, 2008 6:17 pm

I have a website with links on the top of each page which are identical to each other. Is it possible to include this into the css instructions rather then create them (and when necessary change all 60) when necessary?
User avatar
cking
Geek
Geek
 
Posts: 75
Joined: Wed Nov 09, 2005 1:00 am
Location: Berlin, NH

Thanks given:0
Thanks received:0
Top

Postby Gecko » Thu Mar 06, 2008 8:41 pm

cking,

No you cannot do that with css, however your can do it with a php include file statement.
I would post the code here but I'm afraid I would get baned for posting php code (it's happened before)

So here is one link and another link that shows you the basic idea of the include statement.
If you need further help, it will have to be through email but I'm willing to give you a hand with it.
User avatar
Gecko
Super Moderator
Super Moderator
 
Posts: 5209
Joined: Thu Oct 25, 2001 1:00 am
Location: Florida, USA

Thanks given:1
Thanks received:23
Top

Postby cking » Thu Mar 06, 2008 9:15 pm

Thanks Gecko unfortunatley we are tring to stay away from PHP code on this site as much as possible (higher request due to potential attacks) can it be done through a Script such as a javaScript file?
User avatar
cking
Geek
Geek
 
Posts: 75
Joined: Wed Nov 09, 2005 1:00 am
Location: Berlin, NH

Thanks given:0
Thanks received:0
Top

Postby Gecko » Fri Mar 07, 2008 5:47 pm

cking,

Yes you can do it with java but once again I cannot post it here.

But if you click this Link you can get the basic idea on how to do it.
That should get you going, if not let me know and we will work it out.

Remember don't post any java or php here you will get banned.
Even if you put it in a code tag you will still get banned!

It's happened to me more than once :(
User avatar
Gecko
Super Moderator
Super Moderator
 
Posts: 5209
Joined: Thu Oct 25, 2001 1:00 am
Location: Florida, USA

Thanks given:1
Thanks received:23
Top

Postby cking » Mon Mar 24, 2008 7:57 pm

Thanks Gecko that did what I was aiming for minus a couple things that I need to work out
User avatar
cking
Geek
Geek
 
Posts: 75
Joined: Wed Nov 09, 2005 1:00 am
Location: Berlin, NH

Thanks given:0
Thanks received:0
Top

Re: CSS help

Postby pradip030384 » Sat Oct 04, 2008 6:54 pm

You should try to use Tables instead of CSS.
pradip030384
Newbie
Newbie
 
Posts: 3
Joined: Sat Oct 04, 2008 10:30 am

Thanks given:0
Thanks received:0
Top

Re: CSS help

Postby cking » Sun Oct 05, 2008 5:04 am

CSS is the standard when you are tring to make fonts, links, headers and other tag elements as well as some positionings to look a certain way though out your site. The use of tables complicates things instead of making them easier for example if you want to change the font color on your h1 tags to blue in css you are able to add a line in the css file and all pages that are set up to look at that file and have a h1 tag will show as blue. With tables you would have to go through and change every h1 tag to blue on each page which is what I'm attempting to avoid doing.

Furthermore I found a solution to my problem DreamWeaver has what is know as a Library you just need to add the coding to the Library and then point it to each page you want it to show on. Works great for static links that don't change. If you want to change something just change the Library and save the changes.
User avatar
cking
Geek
Geek
 
Posts: 75
Joined: Wed Nov 09, 2005 1:00 am
Location: Berlin, NH

Thanks given:0
Thanks received:0
Top

Re: CSS help

Postby Gecko » Tue Oct 07, 2008 1:54 am

cking,

Dreamweaver Library files are not really designed to be used that way but it does work.
Be careful when working on multiple site at a time and the changes made to the Library files!

What I do in Dreamwaever is make a .dwt "Template" file that is then linked to all the pages with that template layout.
You have to add at least one "Editable Region" in the body section, that will become the changing information area on each page that uses that template.
Now I just create my pages and then apply the template to them, and then edit as needed.
If there are changes to be made to the menu let's say then all you have to edit is the template file, save it and apply the changes to all the pages, done.


As for table over CSS, no way, we still do a few sites in tables but only when a client wants a set look and feel across all browsers but we still use CSS for them as well, as you pointed out, it just easier.
User avatar
Gecko
Super Moderator
Super Moderator
 
Posts: 5209
Joined: Thu Oct 25, 2001 1:00 am
Location: Florida, USA

Thanks given:1
Thanks received:23
Top

Re: Includes

Postby CyberCastaway » Wed Feb 15, 2012 8:15 pm

cking wrote:Thanks Gecko unfortunatley we are tring to stay away from PHP code on this site as much as possible (higher request due to potential attacks) can it be done through a Script such as a javaScript file?


You can use a comment, but you have to change the file extension for the page to .shtml.

<!--#include file="addedfile.txt" -->

You have to have that enabled and configured, and how to do it would depend on the web server you are using. If you have a host, it is definitely enabled or they can definitely enable it for you.
CyberCastaway
Newbie
Newbie
 
Posts: 3
Joined: Wed Feb 15, 2012 7:03 pm
Operating System: Windows 7 + Ubuntu + OpenSuse

Thanks given:0
Thanks received:0
Top


Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron