user5005297
user5005297

Reputation:

Identical Items on each HTML page?

I am working on a small HTML project, and there will be quite a few pages. I want each of them to have an title at the top with two pictures besides it.it looks like this.

<table align="center">
<td><img src="picture.jpg" width="200"></td>
<td><h1 class="pagetitle">TITLE OF PAGE</h1></td>
<td><img>src="picture.jpg" width="200"></td>
</table>

I would prefer to do this using only HTML or CSS. If it is not possible, please explain how to do it in another language.

Upvotes: 1

Views: 35

Answers (2)

equi
equi

Reputation: 28

Eric's answer is good, however if you still wan't to use only HTML with CSS, it's much easier. I would suggest you to don't use tables, no reason in this case. You could wrapp those elements into div with the same effect, by using some CSS styling. When you use one stylesheet for all of these pages, there's no additional requests, your browser knows that you already have this stylesheet. Also when your header is almost the same on all pages, it should load very fast.

Upvotes: 0

Eric J.
Eric J.

Reputation: 150148

Depending on your exact requirements, you may be able to use an IFRAME to include the table from a separate HTML source document.

If this line

<td><h1 class="pagetitle">TITLE OF PAGE</h1></td>

requires that the actual title of the specific page be entered, an IFRAME will not work (at least, not without some tricks involving JavaScript).

If you do not use an IFRAME, you need some sort of processing to avoid copying-and-pasting the same header to every page (with the associated problems of updating every page if you change the header).

The typical solution to this type of issue is to use some sort of server-side programming environment such as PHP or ASP.Net.

If this is your only programming requirement, the learning effort should be fairly minimal.

Upvotes: 1

Related Questions