Determining the DTD statement

  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

A couple of questions about the DTD (mostly motivated by trying to validate my code at http://www.w3schools.com/site/site_validate.asp):

1) Is there a reason Frontpage does not place a DTD in a document automatically? Is there a setting somewhere that needs to be tweaked?

2) After reading up a bit about the 3 types of DTD's, I'm a little unsure which DTD i should use. I know it's not strict, so that leaves transitional and frameset. I was leaning towards transitional, but I'm using inline frames in my main page which makes me think I should use a frameset DTD.

3) Just to verify: the DTD tells the browser what style of sytax to expect from the document it is reading. what happens if you have the wrong DTD in your page?

Anyway, enough question for one post :D Thanks for any help or info you can share on this issue!

Mark
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

Transitional should meet most of your needs. Frameset is for actual frames. Transitional should cover the use of iframes in your pages. If you use strict, you HAVE to get the code EXACT for it to validate. It's a great way to improve your skills, but hard to get perfect.

As to the Frontpage question? *lol -- that's Microsoft for ya! *grins.
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

ATNO/TW wrote:
As to the Frontpage question? *lol -- that's Microsoft for ya! *grins.


Yeah, that's what I figured. Oh well. Guess that's the price I have to pay for using frontpage, eh? We all have our crosses to bear!

Thanks for the clarification! As always, outstanding post from ATNO/TW.

Mark
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

So I went ahead and entered the transitional DTD statement into my page, and it had an interesting effect. It altered the appearance of the border on my iframes!

I posted an example of the page I'm working with, both with and without the DTD statement:

Without statement: http://www.markrhodes.us

With statement: http://www.markrhodes.us/dtdindex.htm

I checked the code and the gui interface, and nothing was changed as far as I can see. For some reason the inclusion of the DTD statement is altering the page. It's supposed to go immediately before the <html> tag, correct?

Mark
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

allgoodpeople, this is probably why:

Code: [ Select ]
<td width="19%" align="center" height="1" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">


With the DTD, the browser is correctly interpreting the inline style and giving you a "medium" border like you told it to do.

You've just given a perfect example of how including or excluding a DTD can affect how a page displays.
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

ATNO/TW wrote:

You've just given a perfect example of how including or excluding a DTD can affect how a page displays.


Uh, yeah, I knew that :shock: I was just checking to see if you would notice that too. I thought it would make a good object lesson.

Yeah, that's the ticket.

Seriously, thanks again.

Mark
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Posts: 526
  • Loc: St. John's, Newfoundland, Canada

Post 3+ Months Ago

allgoodpeople wrote:
So I went ahead and entered the transitional DTD statement into my page, and it had an interesting effect. It altered the appearance of the border on my iframes!


The DTD will determine what rendering mode some user-agents employ. mozilla.org explains this in great detail; it is worth the read, even if you don't use their browser.

Some versions of IE pay attention, other don't.
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

ATNO/TW wrote:
allgoodpeople, this is probably why:

Code: [ Select ]
<td width="19%" align="center" height="1" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">


With the DTD, the browser is correctly interpreting the inline style and giving you a "medium" border like you told it to do.

You've just given a perfect example of how including or excluding a DTD can affect how a page displays.


Actually, now that i look at the code, i'm confused. The line you quoted in your post came from the table for the images at the bottom of the page. this is a table unrelated to the iframes i'm using. if that setting were the problem, wouldn't it effect the border for the table at the bottom of the page, not the main table with the iframes in it?

Also, I figured I'd see if removing the bottom table caused the effect to go away, and it didn't. Same funky thick border with the DTD. This leads me to think the medium setting on the bottom table is not the issue. Feedback or thoughts on my analysis?

Hmmm, looks like i've got a good old fashioned troubleshooting session on my hands!

Mark
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

I think that is the purpose of the forum allgoodpeople the "troubleshooting on my own hands" part.....we, especially us regulars and mods like to help people when we can, but , believe me, it's so much more satisfying when folks can figure it out for themselves, even after a little prodding.
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Posts: 526
  • Loc: St. John's, Newfoundland, Canada

Post 3+ Months Ago

ATNO/TW wrote:
...it's so much more satisfying when folks can figure it out for themselves, even after a little prodding.


Well said! Its better to offer advice nudging people towards the path and let them RTFM. Ultimately, that person will be better prepared for future problems.
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

Turned out it was the DTD statement after all. I had copied a statement off the w3schools site, but had not noticed it said it was XHTML rather than HTML 4.01. Once i changed that, it works fine. Thanks for pointing me in the right direction!

your note about the border settings for the table also got me thinking about a different and unrelated problem i'd been having with how the borders were displaying in netscape. got that fixed as well. again, thanks for jumpstarting the ol' brain!

Mark
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

No prob. I would also suggest you study up on external style sheets. A distinct advantage of external CSS is that you can instantly change the appearance of an entire site simply by modifying the elements in the one file (this comes in very handy on large sites. Inline style (which is what you are using) can be used to make changes to specific elements on a one time basis if needed. Trust me, it will make your life easier down the road.
  • allgoodpeople
  • Proficient
  • Proficient
  • User avatar
  • Posts: 379
  • Loc: here

Post 3+ Months Ago

ATNO/TW wrote:
No prob. I would also suggest you study up on external style sheets. A distinct advantage of external CSS is that you can instantly change the appearance of an entire site simply by modifying the elements in the one file (this comes in very handy on large sites. Inline style (which is what you are using) can be used to make changes to specific elements on a one time basis if needed. Trust me, it will make your life easier down the road.


I agree with you. I've been reading up on it, but i'm still not really confident on how to use it, especially for positioning.

mark
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

Start small / grow big. You can quote me on that.

Post Information

  • Total Posts in this topic: 14 posts
  • Users browsing this forum: No registered users and 18 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.