HTML & Layout Trouble

  Gaz W 17:37 31 Jan 03
Locked

I am designing a web site, and I have come across some trouble with the layout. I have created the first page (the usual index.html), which consists of tables creating a top section with the logo, etc, a side section with the main menu and a white section containing the text. I have not put any text into here because the problem would be that I would have to use this page as a template every time I wanted to write a page. As it is going to be quite a large site, this doesn't seem practical, especially when I want to modify the layout!

Is there any way I can make the layout apply to each page more easily, so that I only have to put the text in to each of the pages, without going into complex things like ASP or PHP (for the moment at least)?

  jazzypop 17:42 31 Jan 03

In your web design program, with your template open, press Ctrl-A (to select all), Ctrl-C (to copy), create a new page and press Ctrl-V (to paste).

That should work in most programs. Many web design programs allow you to create a template (similar to Word) that all new pages will be based on. Which program are you using?

  Stokey 17:51 31 Jan 03

Hi Gaz W, it is difficult isn't it? BUT the best places to sort out Site Building probs can be found by doing Goolge on the (your) precise problem.

ALSO ....


Your site host together with it's forum helpers will answer your queries PDQ .... if they're good !!!!

  Gaz W 18:23 31 Jan 03

I am using Notepad and HTML code.

The problem I have is that I don't want to have to duplicate the code for the layout in EVERY page - I just want each page to be able to load the code to do this from one specific page or something like that, meaning I could change the entire layout/colour scheme of the site through one file rather than going through every page just to, say, add one item to the menu at the side or change its colour.

I have used frames in the past, and this is the easiest way to do this, and I am also aware of the <IFRAME> tag, but I don't really like that because it is still a frame and not really part of the page.

Maybe someone knows how PC Advisor manage it with this site? I know it's different, but surely they can't go through every page changing the menus, etc!

  mackaycc 20:20 31 Jan 03

The way to do this is by using Cascading Style Sheets. A Cascading Style Sheet will give the same properties to every page you include it on and then allow you to add the text to the site. For a tutorial on using CSS click here

  short-circuit 20:37 31 Jan 03

Took a look at the above tutorial and as with most cascading style sheets it deals with embedded style tags which go into the head of the page, inline style tags which are coded in HTML tags and linked tags which are called from a separate file. I think you need the linked tags from a separate file: that way you can just update the one file to change the style of every page on your web-site.

Scott

  Gaz W 21:05 31 Jan 03

Thanks for that.

I have used style sheets before, but mainly for formatting the text and background colours and properties like that. I'll see what this tutorial is like

  Gaz W 21:55 31 Jan 03

I was also thinking along the lines of a virtual include or something, but I can't get it to work. I think my web host would need to support it, but this is no good for testing the site at home. I think the command went something like this:

<!--#INCLUDE VIRTUAL="page.html"-->

But as I say it won't work.

I tried changing the extension to .shtml for the page that contains the above tag, but it is still no use!

Is there a way I can get this to work because it would be handy for the menu at the side, so I don't have to keep changing it all the time!

This thread is now locked and can not be replied to.

Huawei P10 review

1995-2015: How technology has changed the world in 20 years

An overview: What leading creative agencies are doing to improve diversity

New iPad, iPhone SE & Red iPhone 7 on sale now