Setting Doctype Messes Up Page??

I

IWP506

When I insert the follow doctype at the top of my page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

it turns my format into crap.

Example:

without: http://img396.imageshack.us/my.php?image=without9da.gif


with: http://img396.imageshack.us/my.php?image=with4fx.gif

It's like it adds extra padding to the data in the tables or something.
I thought validation was supposed to improve your page not ruin it.

The code for the cell in that screenshot:

<td width="100%" bgcolor="#8C0000">
<p align="center"><font color="#FFFFFF" face="Arial"
size="2"><b>Extras</b></font></td>



Any ideas?
 
M

mbstevens

When I insert the follow doctype at the top of my page...
it turns my format into crap.
I thought validation was supposed to improve your page not ruin it.

Doctypes specify how things are to be interpreted. A doctype
will also cause a different interpretation than no doctype.
Validation only tests whether you are following the rules set
out by the doctype -- validation cannot change how your page
is interpreted. You cannot develop a page under no doctype and
expect it to perform the same way when the browser is told to
interpret it under a doctype.

You are still in that shadowland between understanding CSS and
using deprecated markup.

Think about your markup here:
body, p, td {color: #111111;}
<body bgcolor="#F7F7F7">
A very odd mixture, no?

And, I'm sorry, but I find this just bizarre:
<td width="100%" bgcolor="#8C0000">
<p align="center"><font color="#FFFFFF" face="Arial"
size="2"><b>Extras</b></font></td>

You have closed the <td> before closing the <p> under an XHTML
doctype. That is just a mistake. Learn how to nest correctly.
<td>
<p>
<font> <!-- CSS would be better better! -->
Extras
</font>
</p>
</td>

If you don't pay attention to careful indentation, you will
always be running into trouble. Any programming-like task
requires extreme neatness, at least until you're well
experiencecd. Any time you write a tag, go ahead and write
its end tag. Then nest other pairs between. Only after all
that should you insert your text.

Don't reject CSS and DOCTYPE before you have given it enough
time to percolate through your brain for a bit longer. Get
_all_ of the deprecated markup out of your code, move completely
into CSS, and move the CSS into its own file.
 
M

mbstevens

mbstevens said:
You have closed the <td> before closing the <p> under an XHTML
doctype. That is just a mistake.

Correction -- you are still using HTML 4.01, which will allow
this. I do suggest moving to the strict version of this doctype.
 
I

IWP506

Believe it or not, I didn't write that by hand, it's all FrontPage
generated, and I haven't even looked at it until right now when I had
the problem.
 
I

IWP506

My question remains. What can I change about that code to make it
normal? What is to be interpreted?
 
M

mbstevens

Believe it or not, I didn't write that by hand, it's all FrontPage
generated, and I haven't even looked at it until right now when I had
the problem.
No wonder! Run, do not walk, to the nearest trash bin and throw
your CD with FrontPage into it. Modify any good template
instead. I like the ones at realworldstyle.com.
 
M

mbstevens

My question remains. What can I change about that code to make it
normal? What is to be interpreted?
There's no cleaning up completely broken markup like that.
Go for a good template.
 
I

IWP506

No wonder! Run, do not walk, to the nearest trash bin and throw
your CD with FrontPage into it. Modify any good template
instead. I like the ones at realworldstyle.com.

lol, I've been thinking about it... I suppose Dreamweaver works
properly? Looking into getting it.

Anyway, thanks for your help.
 
W

WD10

No wonder! Run, do not walk, to the nearest trash bin and throw
your CD with FrontPage into it. Modify any good template
instead. I like the ones at realworldstyle.com.

lol, I've been thinking about it... I suppose Dreamweaver works
properly? Looking into getting it.

You can get a free editor for Windows called HTML Kit. It has over 400
free plugins. http://www.chami.com/htmlkit/

Also, jEdit.org is a good one, and it's also free.

HTML Kit might be better because it has a "preview" tab. So you can write
the HTML and click the "preview" tab and see what page looks like. With
jEdit, you can preview as you work, but you have to save the document
(CTRL-S) and then CTRL-TAB to switch to the browser and CTRL-R to reload
the changes. It takes a tiny bit longer, but isn't any worse.
 
M

mbstevens

No wonder! Run, do not walk, to the nearest trash bin and throw
your CD with FrontPage into it. Modify any good template
instead. I like the ones at realworldstyle.com.

lol, I've been thinking about it... I suppose Dreamweaver works
properly? Looking into getting it.

If you really want control of your web world, look into Perl and
PHP and Python -- look into ways of generating pages through
databases. WYSIWYG editors will only slow your learning of
basic (X)HTML, which you will need to know before you can
generate pages on the fly in response to visitor input.
 
L

Leonard Blaisdell

My question remains. What can I change about that code to make it
normal? What is to be interpreted?

I don't know anything about Frontpage markup except what I've read about
in the group over a significant period of years. Nearly everyone appears
to think it's absolute junk, but a percentage of people say that you
just have to know how to use it. I'm not sure if they mean for markup or
for dealing with your site via FTP. But someone will tell you this part.
Can you specify a doctype in your program and rearrange the whole thing
from there?
How did you learn that there was a doctype? Just curious.

leo
 

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

Members online

Forum statistics

Threads
473,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top