DOCTYPE ?????

J

Johny

Hi all

do I need to put something along the lines of this at the top of my site?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

I have read up about it and not sure if its really needed.

I have put this at the top of my page and it has made all the tables centre
the next, do I need it and whats going on with the centred text?


John
 
M

Murray

If you do not put it there, each browser will render your page in quirks
mode. Each browser interprets quirks mode more or less differently
depending on the day of the week, the phase of the moon, and the conjunction
of the planets. If you are not so concerned about browser renderings of
your pages, then this will be fine.

Also, if you do not put it there, your page will not validate according to
the W3C's rules for valid HTML 4.01.

If you put it there, then each browser will know that you are using standard
HTML 4.01 Transitional code and methods. You will still encounter browser
rendering differences from one browser/platform to another, but there will
be fewer than in quirks mode. In addition, your pages MAY validate with the
HTML 4.01 specs, depending on the usages you have applied on the page.

Here's a good example:

This page -

<html>
<head>
<title>Invalid</title>
</head>
<body>
<table bgcolor="red" height="100%" width="100%">
<tr>
<td>words</td>
</tr>
</table>
</html>

will fill the page horizontally and vertically with red color, even though
the content of the table is just one word. But the code on the page is
invalid, since table height is not (and never has been) part of the HTML
specification. The notion is that any container should be 'shaped' by its
contents. Quirks mode has attempted to interpret what you wanted to happen,
and (in this case) has made the right choice.

Add your doctype to this page, e.g.,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Invalid</title>
</head>
<body>
<table bgcolor="red" height="100%" width="100%">
<tr>
<td>words</td>
</tr>
</table>
</html>

and the page will NOT fill with color because the browser is looking for
standard HTML, and table height doesn't qualify.

How do you know what to do, then? Well, the only way really is trial and
error. And reading.... And this forum among others.
 
J

Johny

Thanks for the reply

What is it that makes the text become centred in the tables?
Is there anything in frontpage I can change so that it defaults to the left
instead of the centre?

Cheers
 
T

Thomas A. Rowe

Click into the table/cell, then right click and select Cell Properties, then set your alignment
values.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
K

Kathleen Anderson [MVP - FrontPage]

In IE 5 and above, if you don't specify alignment for the content of a cell,
it will inherit its alignment from the table that it's in. So, unless the
table is also aligned left, you need to specify the cell alignment as left.
But I wouldn't depend on that working the same way in all browsers.

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/
blog: http://msmvps.com/spiderwebwoman/category/321.aspx
 
M

Murray

When I'm creating a page, I usually always have the following CSS -

body { text-align:center; }
#wrapper { text-align:left;...}

and the following HTML -

<body>
<div id="wrapper">
.....
</div>
</body>

I do this for various reasons, one of which is the thing that Kathleen
mentions - the text-align: left explicitly sets all the text inside of the
<div id="wrapper"> to be left aligned. This neatly sidesteps the issue of
inheritance of table alignment into the individual cells.
 
T

Tina Clarke

Johny said:
Hi all

do I need to put something along the lines of this at the top of my site?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

I have read up about it and not sure if its really needed.

I have put this at the top of my page and it has made all the tables centre
the next, do I need it and whats going on with the centred text?

http://mvp.wiserways.com/tutorials/doctype/index.htm

This link might prove helpful

Tina

Tip now out is: Title Attributes (tags) in FrontPage
http://frontpage-tips.com/ - FrontPage Tips
They are primarily for FrontPage 2003 but will be good
for earlier versions too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top