doctypes (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


reformed hater -> doctypes (3/28/2006 10:16:51)

I didn't want to hijack someone else's thread so here i am....
I still don't get doctypes. I've read the articles provided by Womble, and still don't get them. Then I was informed that since I was new to coding to use a "loose" doctype, but that just messes up my layout. [:(]
this is my temporary page just so you can look at what I'm talking about....
What type of doctype is this and how do you know?!?!?!?!?!
HELP!!!!!!!!!!!!




womble -> RE: doctypes (3/28/2006 10:40:23)

Okay, step by step then...(might be an idea to get a book on html, or check out the W3C's specifications for (x)html at some point in this process so you can check out what's allowed and what's not)

....so you paste in your doctype - in your case the HTML 4.01 transitional.

quote:

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


It has to go in the code as the very first thing - nothing else goes before it - even the <html> tag.

As you've found that will most probably "mess up your page" because the browser's now trying to render your code according to the official rules. Don't worry, that's kinda supposed to happen at this stage!

Next step, off you go to the W3C Validator with your newly doctyped page and either type in the url in the appropriate box or upload the page to the validator (or cut 'n' paste your code into the direct input box). Choose the 'verbose' option when asked, and it'll try and explain to you in W3C-speak what the problems are.

Next comes the scary bit....click "check" and it'll come up with a whole list of things that are wrong with the code most likely. DON'T PANIC! That's normal. Have a read through what it says, and see if any of it makes any sense, and perhaps try and correct some of the errors it comes up with, then try validating the page again. Problems or anything you don't understand, come back here and give us a shout.




Tailslide -> RE: doctypes (3/28/2006 10:40:57)

I think the Geocities code inserted into your page may cause problems. You may get a better idea checking locally using Firefox etc.

Spit explained it perfectly on the other thread.

There are quite a few different types of HTML and browsers interpret them differently. Basically what a DOCTYPE does is tell the browser what type of coding you're using (loose, strict, frameset etc etc). This helps the browser to display the page exactly how you meant it to be displayed. If you don't include a DOCTYPE then the browser will take a guess. It might get it right. It might not. It's a gamble. If you're still coding like it's 1999 then you'll probably be ok as browsers tend to guess to the "lowest common denominator" of code. If you have any intention of trying to use modern, standard compliant markup or CSS then you really need to help the browser out and tell it what you want it to do.

As suggested, if you're starting out and don't want Firefox knocking on your door with a few friends and a baseball bat if you leave off a closing tag then you're probably better off using the most "lenient" DOCTYPE - HTML 4.01 Loose:

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


This goes at the very top of your page before everything else. On your Geocities page - geocities inserts it's code first thing on the page - if this ends up being before the DOCTYPE then it renders it useless (at least in IE can't remember about the rest).

It's much easier to start off with a DOCTYPE in place and then code your page rather than vice versa - but it's not impossible to fix.




womble -> RE: doctypes (3/28/2006 10:45:35)

Ooooops, cross posting! Um, yep, probably best to listen to Spit and Tail (I think I went off at a tangent slightly about validation...[8|]

....I am not addicted to doctypes and validation
I am not addicted to doctypes and validation
I am not addicted to doctypes and validation
I am not addicted to doctypes and validation
I am not addicted....[:D]




spitfire -> RE: doctypes (3/28/2006 10:53:00)

Entirely valid comments for a "silly brit", womble, and I admire your teaching style which should in the "normal" course of events achieve a great result. [:D]
You can't validate too often.
You can't validate too often.
You can't validate too often.
You can't validate too often.
You can't validate too often.
But you'll be wasting your time without a DocType.[;)]




womble -> RE: doctypes (3/28/2006 11:02:59)

Very true old chap. I feel Tail's approach is possibly the correct one - get the doctype, then worry about validation, cos as you so rightly pointed out, without a doctype it ain't gonna happen anyhow.




reformed hater -> RE: doctypes (3/28/2006 15:49:34)

Now after I fix all the 17 errors that W3C told me about is it going to return to it's normal state. Because I really don't want to start coding again[:'(]

Edit: And on the list of doctypes there is nothing for CSS... Me no likey doctypes![&o]




Tailslide -> RE: doctypes (3/28/2006 16:20:30)

It depends on your coding - having a valid page is no guarantee that it will look how you want it to, but it's a good place to start and will make problem solving a lot easier.

Stylesheets don't need DOCTYPES - only the HTML page needs one.




reformed hater -> RE: doctypes (3/28/2006 17:18:13)

yeah well i'm new to this coding thing and so my page is all screwy... so back to the recoding.




womble -> RE: doctypes (3/28/2006 18:04:49)

17 errors? That's not bad going!

It gets easier, honest it does, and before you know it you'll be doing it in your sleep (when you get REALLY addicted [;)])

There's also a CSS validator on the W3C site as well where you can check out your CSS, btw.




Tailslide -> RE: doctypes (3/29/2006 5:32:28)

Yeah 17 errors isn't bad at all. Generally when starting out you'd be looking at dozens of errors.




reformed hater -> RE: doctypes (3/29/2006 9:19:00)

The CSS validator doesn't say that it's valid but it gives me a list of "warnings" along w/ this message:
quote:

To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.

Is it valid? Should I change the warnings?





Tailslide -> RE: doctypes (3/29/2006 9:36:44)

It should say at the top of the page either:
quote:


Congratulations!

Valid CSS! This document validates as CSS!


or

quote:

To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.
Errors


followed by a list of errors.

Warnings are just that - something to correct if possible but don't kill yourself over them.

Edit: I've just checked your CSS in the test page you published and it validates fine.




womble -> RE: doctypes (3/29/2006 9:37:46)

That means that both your (x)html and css have to be valid to be sure all is well.

If it's not saying you have errors, then yes, the css you have is valid, but 'cos it's like that it won't just come straight out and say that.

Warnings are just that - warnings that you *may* run into problems. Often the warnings point out if you have something missing that might cause problems that isn't essential but is good practice.

How far you go down the road of fixing 'em all depends what the "warnings" are. I've just spent an hour wading through a monster css file tidying up because the damned thing's obsessive at the moment about having background colours to go with colours (which is good practice tho in case users have a user-defined stylesheet that clashes with yours). Even once you get rid of all the warnings it doesn't come up with a nice cheery "congratulations" or something lke that though. It's mean like that. [:(]

All depends on how good you want to be.

What's it coming up with?




womble -> RE: doctypes (3/29/2006 9:41:28)

quote:

ORIGINAL: Tailslide

It should say at the top of the page either:
quote:


Congratulations!

Valid CSS! This document validates as CSS!


or

quote:

To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.
Errors


followed by a list of errors.


Not fair! I just got a page to validate with all the warnings gone and I still didn't get the congrats message - just
quote:

No error or warning found

To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.

It's being mean today! [&o]

Edit: can't remember now tho if you only get the cheery congrats message if you do it by url - I've been using file upload today...or maybe it just doesn't like me any more...[:(]




reformed hater -> RE: doctypes (3/29/2006 9:46:39)

WHOOP WHOOP!!!![sm=yupi3ti.gif] that's 2 count 'em TWO valid sheets!!!!!!!!
Now to fix the freakin' layout because the doctype threw everything for a loop[:'(]


edit: so now it's just a matter of tweaking the positioning of everything, right? Because my page looks nothing like it did before.




reformed hater -> RE: doctypes (3/29/2006 10:35:36)

Is it bad if I don't have valid sites? It seem to be a pain (at least for my employer's site) for my side projects, clients, etc. I will, but is it bad? None of our competition have valid sites and we're an A/C company how many people really are going to see/understand....[sm=rolleyes.gif][sm=innocent.gif]

I THANK YOU ALL FOR EVERYTHING![sm=bowdown.gif]




Tailslide -> RE: doctypes (3/29/2006 10:43:17)

You know when you were a kid and your mother/father whoever used to say to you:

"Well if (insert name here) jumped off a cliff would you follow them?"

Well the same thing applies.

The reason there's so many invalid sites around (apart from laziness on the part of the developers) is that they'll say the same thing - well (insert name here)'s site isn't valid so why should I bother? Thing is - if we start bothering then we'll improve the web. Then others will start bothering too. Think of it like picking up litter.

Is the god of validity going to strike you dead for having an invalid site? No probably not. Is it difficult to get right when you start down this road? Oh yes. Does it get easier? Much easier.

In the end I'd say if you're just doing a single site for fun then don't drive yourself insane over it. BUT if you're doing this for a living or doing a business site then I believe it's your responsibility to do it properly. Others will no doubt disagree with me.




dpf -> RE: doctypes (3/29/2006 10:48:30)

quote:

Others will no doubt disagree with me.
does today end in "y"?




reformed hater -> RE: doctypes (3/29/2006 11:00:31)

I understand what you are saying Queen Tail, but this is my thought: Know your audience. No one but me will understand (and I barely get it) the valid vs non valid sites. the only thing in the non valid world that troubles me is the cross browser function.




dpf -> RE: doctypes (3/29/2006 11:15:05)

Rh ; it doesnt have to be either or. you are new to all this - you readily admit to that - we all were, right. why not move forward on 2 tracks. track 1 - do the site you need to do for your employer - use the best coding you can but making it work and look nice is priority one. track 2 ?? you sem committed to learning so track 2 is spending time learning proper coding..maybe making some test sites or a personal site. with guidance from experts like tail and spit and caz and womble et.al, you will be ther in no time (avoiding people like golfer and yours truly is essential to your progress)




Tailslide -> RE: doctypes (3/29/2006 11:18:44)

I doubt any of my clients have a clue about valid invalid sites (and believe it or not I don't bore them with the details... honestly I don't) - neither do 99% of people who look at the sites. That's not the point... the point is that I'd know and it would really bother me.

In the end you'll do what you feel happy with. I can't tell you that it's alright to have invalid mark-up because I don't believe it is (personally) - but others don't care at all...

You now have a clearer idea of the issues - so you can make a more reasoned decision. Don't give up on it because it's a bit hard though - nothing worthwhile is easy (and other such cliches!).




spitfire -> RE: doctypes (3/29/2006 11:52:56)

quote:

with guidance from experts like tail and spit (moi?... never) and caz and womble et.al,

Dan
I can't believe you said that. Join me in a celebratory glass of bubbly sometime. Or a Budd/Heineken/whatever if you must[8D]




reformed hater -> RE: doctypes (3/29/2006 12:05:35)

Oh, do believe that I won't give up...
And you all have helped me more than you know. So enjoy a pint and some tea and crumpets (for you brits) and whatever world cliché we Americans eat/ drink on me[sm=tongue.gif]
And you won't see the last of me... this place is like heroin

I think that I'll do the 2 track thing. Make a non-valid site for work (It will annoy me but don't feel like taking the time to do something that my name won't be one/ be in my portfolio) and my client's site will be 100% valid. with your help of course[;)]




Minix -> RE: doctypes (3/29/2006 12:38:20)

I only do a select few sites - about 8 right now. I don't look for new business, but rather design for the projects and clients I select. They are all very basic static sites for informational purposes only. I use FP and very little else. A little CSS here and there, but basic tables, cells and images, with the standard browser friendly texts.

I never use a doctype.

In the last three years, I've had very, very few instances of people not being able to view the sites or having problems accessing the sites for what they are intended to do - get information to the surfers. In any of the browsers.

I tried the doctype thing once at the beginning of a design. It created nothing but problems.

So basically I cover my eyes with both hands and say "You can't see me"!




spitfire -> RE: doctypes (3/29/2006 12:41:50)


quote:

ORIGINAL: Minix
I've had very, very few instances of people being able to view the sites

Err.. would you like to take the chance to edit that?




reformed hater -> RE: doctypes (3/29/2006 12:43:59)


quote:

ORIGINAL: Minix
In the last three years, I've had very, very few instances of people being able to view the sites or having problems accessing the sites for what they are intended to do - get information to the surfers. In any of the browsers.


You do mean that you have had very instances of people NOT being able to view, right. Because the that would be counter-productive [:)]




spitfire -> RE: doctypes (3/29/2006 12:46:51)

Quite. Have we reached a consensus RH?




Tailslide -> RE: doctypes (3/29/2006 12:49:24)

quote:

ORIGINAL: Minix
So basically I cover my eyes with both hands and say "You can't see me"!


Errrmm ok...




Minix -> RE: doctypes (3/29/2006 13:01:30)


quote:

ORIGINAL: spitfire


quote:

ORIGINAL: Minix
I've had very, very few instances of people being able to view the sites

Err.. would you like to take the chance to edit that?


Yes. Thank you.




Page: [1] 2   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125