English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I new to web design, So I need to know How to use the same layout for all my webpages. I've tried the hard way by copy and pasting the codes on the various pages, but Its hard when you update one page, then you have to do the same to all the other layouts too. I've heard of cgi scripts that I can use for the header, navigation and footer so That it appears on all the pages. But I got no idea where to look

2007-02-20 03:24:38 · 2 answers · asked by Crunk 1 in Computers & Internet Programming & Design

2 answers

The easiest way is to use include files and CSS.

Split your HTML code up so that the parts that stay the same (header, footer, etc.) are in separate files. Then you just have a bunch of files with the parts that are different (the content). Then do the following where you cut the common parts out:

where file.inc is the name of your header, footer, or whatever file. So, your new pages will look like this:


my content


When your page is requested from the web server, it will insert the contents of header and footer where those markers are, and send the completed page to the user.

Your web host does have to support include files, however. Contact them to make sure they do.

CSS is a way of separating design from content. You create CSS "styles" which are definitions - for example, all

tags should have a font Times New Roman and size 12pt, and color #333333. By using CSS, you can change your design elements in one place and it takes effect across the site.

Learn more about CSS here: http://www.w3schools.com/css/default.asp

2007-02-20 03:28:11 · answer #1 · answered by Rex M 6 · 0 0

Forget you ever heard of CGI. You need CSS - Cascading Style Sheets. With these you set the styles, layouts, fonts etc. for every page in 1 small file. If you change anything in that .css file, it filters down to every page automatically.

See these websites:

(start with this one)
http://www.htmldog.com/guides/cssbeginner/

http://www.w3schools.com/css/css_intro.asp

http://www.htmlgoodies.com/beyond/css/

2007-02-20 11:30:05 · answer #2 · answered by David B 4 · 0 1

fedest.com, questions and answers