473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Various DOCTYPE questions.

Hello all,

I'm somewhat of a newbie to webscripting. I've made a couple of websites in
the past with WYSIWYG software, but now I'm much more interested in manual
scripting. I have some questions about DOCTYPE:

1. Is a doctype statement *required*, or is it just "strongly suggested"? I
would probably be using a Transitional doctype.

2. I understand that in a frameset I must use a Framset Doctype ststement,
but what about the individual pages within the frameset? Must I use the
Frameset Doctype statement in those pages as well? Would they even have a
doctype at all, or is the Frameset doctype enough?

3. Does a doctype statement actually *do* anything, or is it just a
declaration that you're following a standard?

I ask question #3 because none of my websites currently have a DOCTYPE
statement, but inserting a DOCTYPE statement sometimes screws up the
formatting of the page. DIV's don't line up, borders aren't always right,
JavaScripts (that I've downloaded) don't work the same way. Also, horizontal
scroll bars show up where they weren't before. But when I validate the page,
the validator doesn't show anything wrong with the elements that are
affected.

For instance: In my personal homepage, I have a <div> with an orange dotted
border that's lined up within a frame. It lines up nicely the way I intended
it. But when I insert the <Transitional> doctype, the div stretches across
the page and the text doesn't fit right.

So I'm just wondering how important they are. Eventually I want to validate
all my pages and include doctypes. Just in case anyone is interested, here
are two of my sites. Thanks in advance for any replies.

http://home.comcast.net/~vikenk
http://www.sayatnova.com

--
Viken K.
http://home.comcast.net/~vikenk

Oct 19 '05 #1
25 2684
Once upon a time *Viken Karaguesian* wrote:
Hello all,

I'm somewhat of a newbie to webscripting. I've made a couple of websites in
the past with WYSIWYG software, but now I'm much more interested in manual
scripting. I have some questions about DOCTYPE:

1. Is a doctype statement *required*, or is it just "strongly suggested"? I
would probably be using a Transitional doctype.
A: It's *required* if you want the page to validate, and even if not
it's "strongly suggested".

Use a full doctype (with the link)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

2. I understand that in a frameset I must use a Framset Doctype ststement,
but what about the individual pages within the frameset? Must I use the
Frameset Doctype statement in those pages as well? Would they even have a
doctype at all, or is the Frameset doctype enough?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

Goes only in the frameset file, transitional to all other individual
pages.

3. Does a doctype statement actually *do* anything, or is it just a
declaration that you're following a standard?
Yes, it does. It makes the browsers render the pages without guessing
what they should look like, when rendering them in Standard Mode and
not in Quirks Mode.

I ask question #3 because none of my websites currently have a DOCTYPE
statement, but inserting a DOCTYPE statement sometimes screws up the
formatting of the page. DIV's don't line up, borders aren't always right,
JavaScripts (that I've downloaded) don't work the same way. Also, horizontal
scroll bars show up where they weren't before. But when I validate the page,
the validator doesn't show anything wrong with the elements that are
affected.

For instance: In my personal homepage, I have a <div> with an orange dotted
border that's lined up within a frame. It lines up nicely the way I intended
it. But when I insert the <Transitional> doctype, the div stretches across
the page and the text doesn't fit right.

So I'm just wondering how important they are. Eventually I want to validate
all my pages and include doctypes. Just in case anyone is interested, here
are two of my sites. Thanks in advance for any replies.

http://home.comcast.net/~vikenk
http://www.sayatnova.com


Have you really tried to validate your pages? Have you ever looked on
your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that's *not* Mozilla's fault :)

Add the doctype declarations and then validate on
http://validator.w3.org/ (HTML)
http://jigsaw.w3.org/css-validator/ (CSS)

You have several serious errors in your CSS.

--
/Arne
Now killing all top posters and posters who don't quote
* How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
* From Google: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------
Oct 19 '05 #2
Viken Karaguesian wrote:
1. Is a doctype statement *required*, or is it just "strongly
suggested"? I would probably be using a Transitional doctype.


New documents should use a Strict doctype. Transitional is for minor
updates to old legacy pages where you don't want to take the time to do
work such as remove presentational code into a CSS stylesheet.

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

See: <http://www.w3.org/QA/2002/04/valid-dtd-list.html>

Also, google for "frames are evil"

--
-bts
-When motorcycling, never follow a pig truck
Oct 19 '05 #3
> Have you really tried to validate your pages? Have you ever looked on
your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that's *not* Mozilla's fault :)


Yes, I have, and they don't validate well. :>( I know how my webpage looks
in Mozzila and have not been able to figure out why it looks like that. I'm
not very knowledgeable about html, so I'm trying to get more in depth to
figure out why it's that way. It seems to look fine in Opera, but some of
the colors seem a bit off.
Oct 19 '05 #4
Viken Karaguesian wrote:
It seems to look fine in Opera, but some of
the colors seem a bit off.


Anything to do with "orange" ?

<http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fhome.comcast.net%2F%7Ev ikenk%2Fviken.css&warning=1&profile=css2&usermediu m=all>

--
-bts
-When motorcycling, never follow a pig truck
Oct 19 '05 #5
[attribution restored]

Arne <in*****@domain.invalid> wrote:
Have you really tried to validate your pages? Have you ever looked on
your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that's *not* Mozilla's fault :)

Viken Karaguesian <vi****@NOSPAMcomcast.net> wrote: Yes, I have, and they don't validate well. :>( I know how my webpage looks
in Mozzila and have not been able to figure out why it looks like that. I'm
not very knowledgeable about html, so I'm trying to get more in depth to
figure out why it's that way. It seems to look fine in Opera, but some of
the colors seem a bit off.


Looks fine? Okay, if you say so. My copy of Opera shows a hit counter in
the left frame, which is otherwise empty (and wasting 20-25% of the browser
window). And the right frame shows several empty boxes that look like
they're supposed to be images.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Adventure is nothing but a romantic name for trouble." - Louis L'Amour
Oct 19 '05 #6
> Looks fine? Okay, if you say so. My copy of Opera shows a hit counter in
the left frame, which is otherwise empty (and wasting 20-25% of the
browser
window). And the right frame shows several empty boxes that look like
they're supposed to be images.


Really?? When I view with Opera, I see that the hit counter is empty, but I
see all the images...
Oct 19 '05 #7
Re: http://home.comcast.net/~vikenk/
I wrote:
Looks fine? Okay, if you say so. My copy of Opera shows a hit counter in
the left frame, which is otherwise empty (and wasting 20-25% of the
browser
window). And the right frame shows several empty boxes that look like
they're supposed to be images.

Viken Karaguesian <vi****@NOSPAMcomcast.net> wrote: Really?? When I view with Opera, I see that the hit counter is empty, but I
see all the images...


Expanding http://home.comcast.net/~vikenk/home.htm to the full browser
window, there is a grid of 6 images along the right edge. They're all just
white outlines, and it looks like they're all the same image:

http://home.comcast.net/~vikenk/other_pics/cell.gif

A 1x1 GIF? Looking at the source, you seem to be using some JavaScript hack
to replace this image with various other images, based on the ID attribute.

See http://www.xs4all.nl/~sbpoley/webmatters/whatnojs.html
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Adventure is nothing but a romantic name for trouble." - Louis L'Amour
Oct 20 '05 #8
Expanding http://home.comcast.net/~vikenk/home.htm to the full browser
window, there is a grid of 6 images along the right edge. They're all just
white outlines, and it looks like they're all the same image:

http://home.comcast.net/~vikenk/other_pics/cell.gif

A 1x1 GIF? Looking at the source, you seem to be using some JavaScript
hack
to replace this image with various other images, based on the ID
attribute.


I still see all the images along the right. Yes, it is a Javascript.

Some explanation: According to the author of the menu system that I use (HV
Menu www.burmees.nl/menu), the menu must wait until all the images are
loaded before the menu appears. But if there are lots of images, this will
take lots of time for the menu to appear, especially for the dial-up users.
He claims it's in the design and is inflexible.

His suggested workaround is to load up some dummy images (the 1x1 cell.gif)
to "trick" the menu into appearing first, then using the suggested
Javascript to swap the real images in place of the dummy image. This makes
the menu appear very quickly.

I tried his suggestion and it seemed to work OK. I keep checking his website
to see if he modified the menu to appear before everything else in the page,
but so far, I have the latest version.

I just don't understand why the website looks as it does in Mozilla.
Oct 20 '05 #9
> Have you really tried to validate your pages? Have you ever looked on
your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that's *not* Mozilla's fault :)

Add the doctype declarations and then validate on
http://validator.w3.org/ (HTML)
http://jigsaw.w3.org/css-validator/ (CSS)


My cleaned-up CSS now validates!
Oct 20 '05 #10
I wrote:
Expanding http://home.comcast.net/~vikenk/home.htm to the full browser
window, there is a grid of 6 images along the right edge. They're all just
white outlines, and it looks like they're all the same image:

http://home.comcast.net/~vikenk/other_pics/cell.gif

A 1x1 GIF? Looking at the source, you seem to be using some JavaScript
hack to replace this image with various other images, based on the ID
attribute.

Viken Karaguesian <vi****@NOSPAMcomcast.net> wrote: I still see all the images along the right. Yes, it is a Javascript.

Some explanation: According to the author of the menu system that I use


Menu system? What menu? There was no menu.

See http://www.xs4all.nl/~sbpoley/webmatters/whatnojs.html
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

aquapella /"a-kw&-'pe-l&/ adj. sung in the shower
Oct 20 '05 #11
> Menu system? What menu? There was no menu.

Ahhhhh...I see. You were only looking at the "home.htm" page? The full
website is actually a frames page (I know, I know....frames are evil).

Go to http://home.comcast.net.~vikenk to view the page in it's entirety.

BTW, my version of Opera is: 7.54u2
Oct 20 '05 #12
I wrote:
Menu system? What menu? There was no menu.

Viken Karaguesian <vi****@NOSPAMcomcast.net> wrote: Ahhhhh...I see. You were only looking at the "home.htm" page?
Originally, I went to http://home.comcast.net/~vikenk/

As I said earlier, the left frame contained only a hit counter. So I
expanded the right frame to take the whole window.
BTW, my version of Opera is: 7.54u2


Mine is version 8.5.

JavaScript is normally disabled.

See http://www.xs4all.nl/~sbpoley/webmatters/whatnojs.html
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

aquapella /"a-kw&-'pe-l&/ adj. sung in the shower
Oct 20 '05 #13
On Wed, 19 Oct 2005, Viken Karaguesian wrote:
I still see all the images along the right.
Try reading the followup you got. Otherwise, the time that you're
wasting isn't only your own.
Yes, it is a Javascript.
Then stop making your pages *dependent* on Javascript. As has already
been pointed out to you.
Some explanation:


It's *you* who is in need of explanation, not us. So try reading the
explanations; or stop asking for advice and failing to take it.
--

Since XP XP2, you have the option: of having your Windows dangerously
open, or uselessly shut. -- Richard Bos in the Monastery
Oct 20 '05 #14
>> BTW, my version of Opera is: 7.54u2

Mine is version 8.5.

JavaScript is normally disabled.


Could that be why the Menu never appeared? Without Javascript, the image
swap never executed so the Menu never appeard? I dunno. What I *do* know is
that the 250 MB of free space Comcast gives me is on extremely slow servers!
Oct 20 '05 #15
> JavaScript is normally disabled.

Never mind my previous post. The entire menu is based on Javascript. THAT's
why you never saw it...
Oct 20 '05 #16
WOW! Are you guys always this nasty to beginners who ask for advice??
SHEESH!
Oct 20 '05 #17
Once upon a time *Viken Karaguesian* wrote:
Have you really tried to validate your pages? Have you ever looked on
your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that's *not* Mozilla's fault :)

Add the doctype declarations and then validate on
http://validator.w3.org/ (HTML)
http://jigsaw.w3.org/css-validator/ (CSS)


My cleaned-up CSS now validates!


That's a good start. Now start using valid CSS the right way to make
the page work. :)

Remove the class="info" div tag from the page, so the text gets
visible. I don't know what it's supposed to do and can't see any need
of it.

--
/Arne
Now killing all top posters and posters who don't quote
* How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
* From Google: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------
Oct 20 '05 #18
Once upon a time *Beauregard T. Shagnasty* wrote:
Viken Karaguesian wrote:
1. Is a doctype statement *required*, or is it just "strongly
suggested"? I would probably be using a Transitional doctype.
New documents should use a Strict doctype. Transitional is for minor
updates to old legacy pages where you don't want to take the time to do
work such as remove presentational code into a CSS stylesheet.


Well, he is using frames, so the Transitional is required in order to
get the "target" attribute valid.
Also, google for "frames are evil"


Oh, yes. That's a totaly different matter :)

--
/Arne
Now killing all top posters and posters who don't quote
* How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
* From Google: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------
Oct 20 '05 #19
Viken Karaguesian wrote:
I'm somewhat of a newbie to webscripting. I've made a couple of websites in
the past with WYSIWYG software, but now I'm much more interested in manual
scripting. I have some questions about DOCTYPE:

1. Is a doctype statement *required*, or is it just "strongly suggested"? I
would probably be using a Transitional doctype.
As answered by someone else, a webpage _should_ include a doctype.
2. I understand that in a frameset I must use a Framset Doctype ststement,
but what about the individual pages within the frameset?
The page within the frameset, if they use HTML 4.01 for exemple, should
include a corresponding doctype. The frameset doctypes are to be used
only in pages containing the frameset elements.

For a list of existing doctypes you can read :
"Recommended DTDs to use in your Web document."
http://www.w3.org/QA/2002/04/valid-dtd-list.html
3. Does a doctype statement actually *do* anything, or is it just a
declaration that you're following a standard?


Very good question !
The first goal of a doctype is to indicate the version of (x)html used
in the document. But... Since Internet Explorer for Macintosh 5, most
browser use a "doctype switching mode". You can find some informations
about this here :
http://hsivonen.iki.fi/doctype/
Oct 20 '05 #20
On Wed, 19 Oct 2005, Viken Karaguesian wrote:
http://home.comcast.net/~vikenk
http://www.sayatnova.com


Welcome to the universe of the clueless!
http://google.com/search?q=This.page.uses.frames.but.your.browser.do esn't.support.them

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lang>

Oct 20 '05 #21
On Wed, 19 Oct 2005 20:45:43 -0400, Viken Karaguesian wrote:
WOW! Are you guys always this nasty to beginners who ask for advice??
SHEESH!


Having been where you are - and probably will be again - they *aren't*
being nasty. I've gotten some exceptional help from the gang here - and
I've fought tooth and nail sometimes to understand what it is they're
telling me. Refused their ideas and come to regret it.

It's like taking your car to the garage - if you don't know how to fix it
you take it to someone you trust - and I've come to trust these guy (and
gals) even when they're rough enough to tell me that my whole car needs
replacing, forget about replacing the fan belt.

You've gotten some good advice, stop fighting it (I say to myself, as much
as you) and learn why they're telling you what they are.

Kick back, have a tall one and then re-read what they're saying and try it
again - and again - and again - till you get it right! //al (still working
on it!))
Oct 21 '05 #22
Pierre Goiffon <pg******@free.fr.invalid> writes:
The first goal of a doctype is to indicate the version of (x)html used
in the document.


It's the attack of the '90ies.

Reloaded.

Precisely how, according to you, does it achieve that goal?

Oh well...

<http://validator.w3.org/check?uri=http%3A%2F%2Fbednarz.nl%2F%2B%2Fsgml%2Fd octype%2Fversion-info;ss=1;sp=1>

(*sigh*)
Oct 22 '05 #23
Eric B. Bednarz wrote:
The first goal of a doctype is to indicate the version of (x)html used
in the document.


Precisely how, according to you, does it achieve that goal?


I didn't understand very well your post
Anyway, a doctype indicates what DTD is in use. Isn't it a synonym for
"the version of (x)html used in the document" ?
Oct 24 '05 #24
Pierre Goiffon <pg******@free.fr.invalid> writes:
Anyway, a doctype indicates what DTD is in use.
It depends on what you mean by 'indicates' and 'DTD'.

The doctype declaration *contains* the 'DTD in use' (for that one single
document instance). Well, if no explicit subset is present at all, one
could say that the root element 'indicates' the possible corresponding
default entry in a catalog.

If you mean DTD in the sense of 'public text class document type
declaration subset', that's what the doctype thingie indeed 'indicates';
if you mean 'Document Type Definition' in the more general meaning of a
set of formal markup declarations and some prose describing their
purpose, then no, the doctype declaration is no indication at all that
this definition actually applies.
Isn't it a synonym for
"the version of (x)html used in the document" ?


No. Take the time to read

<http://groups.google.com/group/comp.text.sgml/msg/c3e53dee2c152a81>

That's why doctype sniffing is such utter complete nonsense (it should
be noted, by the way, that SGML does not allow its -- conforming --
applications mystery meat restrictions as expressed in 7.2 of HTML 4;
but the HTML spec is stuffed with blunders anyway; as discussed in
another group just recently, the id attribute value is defined as 'case
sensitive' -- and 'web standards aware' application developers naturally
make some fuss about implementing that -- in the prose while it has a
declared value of ID and case folding applies... DOH).
Oct 24 '05 #25
Eric B. Bednarz wrote:
Anyway, a doctype indicates what DTD is in use.


It depends on what you mean by 'indicates' and 'DTD'.

(...)
Isn't it a synonym for
"the version of (x)html used in the document" ?


No. Take the time to read

<http://groups.google.com/group/comp.text.sgml/msg/c3e53dee2c152a81>

(...)

Thanks for these informations
I'll read them back home
Oct 25 '05 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Garmt de Vries | last post by:
For a long time, I've used CSS to style my webpages, but only for media "screen" and "print". Now I've started looking into styling them for other media like "projection" and "handheld". I'd be...
5
by: Hello | last post by:
Here problem is that in Mozilla the logo "The Website" will not pad from the edge. http://www.clickatus.com/test/ Also, when I put in loose DOCTYPE it blows the whole thing... Help......
5
by: Viken Karaguesian | last post by:
Hello everyone, I have a question about the XHTML doctype. I often times see this statement included in the <html> tag: <html xmlns="http://www.w3.org/1999/xhtml"> If I use the full...
50
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
24
by: TC | last post by:
Hi folks I want to enhance my website to distinguish "external" hyperlinks from "internal" ones. With that aim, I've written the following two small files for testing purposes: ...
1
by: David Thole | last post by:
Hey all, So far my reading is proving to be very interesting and good. This book is very helpful, and I'm generally left with quite a few questions about how I'm going to do stuff with my...
19
by: Edward | last post by:
Why is it when I have a DOCTYPE line in my HTML then "margin" and "padding" are ignored? This happens in both inline and stylesheet styles. It happens for both XHTML and HTML doctypes. It...
0
drhowarddrfine
by: drhowarddrfine | last post by:
The Doctype or DTD Many coders get confused by all the talk of doctypes and how they affect browsers and the display of their web pages. This article will get right to the point about doctypes...
1
by: rfr | last post by:
Apparently the Transitional Doctype kills this script because the script does not make proper use of units like "px". It works well without a doctype statement. But once someone adds a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.