![]() |
w3c validation?
Can someone explain what w3c validation is?
I was told to put this code at the top of my html documents in my website. Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0validator.w3.org The errors sounded so rediculous. I didn't know that you can't use the <br /> tag. It said there is no such thing as the "bgcolor" attribute of the <body> tag. It said there is no "name" attribute of the <a> tag. These sound so rediculous. Can someone help me out? |
W3C validation checks for compliance with the accepted standards of HTML code.
The W3C standard is the basic level of support you can expect from all web browsers. Often, certain browsers will support much more than what's expected by the W3C standards, but what is supported and how it's supported may change from one browser to the next. Some people are diehard compliance freaks, some are not. |
Oh man. It's just so overwhelming whenever someone starts to learn about writing actual HTML as per W3C standards. Up until now, you've probably been writing code for so-called 'version three' browsers, also known as 'tag soup.' Don't worry, there are still a lot that do, because knowledge of how browsers interpret info isn't common. Ever find it strange that some tags exist in some browsers but not others? Not if you write for standardized HTML (which every modern browser and HTML editor now uses predominantly). Not only does the W3C (among many other things) standardize what HTML tags a browser should and shouldn't read, but it also states exactly how browsers should read them, and tells authors how to write for them. I suggest you make it a habit of writing HTML 4-compliant code, or else things are so much more difficult and so much more ludicrous. It'll get tougher and tougher to write code as you have presumably been doing in the long run, as all user agents are starting to run on standards.
The W3C is where HTML, CSS, RSS, XML, etc. is standardized and developed under the watchful eyes of all interested companies (e.g. Microsoft, Apple, Opera). The DTD (Document Type Definition) you were told to put in tells the browser what standard of HTML you are following. It drastically changes how the web brower will interpret your data. If your Doctype were to say "HTML 3.0," the set of legal tags the browser reads is different; in general, the lower the number the closer it is to 'tag soup,' which is what webdesigners call the code written in the early 90's when Netscape and Microsoft made up their own stuff and the W3C barely kept the Web together (begging Netscape to support <blink> or Microsoft to support <embed> and on and on). If you don't have a DTD, a browser would read your code in its 'quirks mode' which is designed to use its error-handling to interpret potentially bad code and still output something good. If you have a new DTD (The final release of HTML is version 4.01.), the browser will be more strict in its interpretation (using 'standards mode') of your code and will do things closer to what you'd expect. Now all that being said, there are a lot of people who are obsessive over the W3C without knowing the purpose of standards. Also, a lot of people just don't think they are necessary (which may be true to a limited extent in this day in age). Think of it this way though: if you choose to write standard HTML, make sure it is semantically correct. Many proponents of standards run their code through a validator and think that's it. It isn't. For example, your title should be enclosed in <h1> and your paragraphs should be enclosed in <p> and your <input>s should be labeled... I noticed your team's site (SPAM's) uses standards (and looks very nice, might i add, as long as you have 1024 x 768 or higher screen resolution) but isn't all that semantically correct for example. Not bad, but not great; there are a lot of double line breaks, excessive <h1>s and improper uses of lists. Anyway, enough about that. Just remember, this stuff is easy to learn, and very tough to master. One last thing, W3Schools is a good place to go to learn about this stuff. |
Thanks, but I am a big hurry to get the site up and running for the customer. I think it will work in most browsers and I can fix the errors latter on so that it will run better in more browsers. For the time being, should I change anything in that <DOCTYPE> tag?
Also, thanks for that great explanation. I learned a lot more from that then from the Lycos tutorial on website validation. Good job and thanks. |
No prob.
If I saw the site, I could give you a more informed answer, but what you have looks good. |
Quote:
Code:
<style type="text/css">Quote:
|
Re: w3c validation?
Quote:
The name attribute has been replaced by "id", and for coloring (like the bgcolor tag), the standard is becoming CSS (style sheets) now (like what Adam said). Except for style sheets, to make it compliant, I think you need to use hex numbers (like #000000 = black, #FFFFFF = white, #808080 = dark grey). CSS isn't dependent upon what language you use (HTML or XHTML). I personally think you should always make it compliant with W3C standards, but that's just my personal opinion. My FIRST site is compliant in both XHTML and CSS, which makes it better for other browsers to view it in, besides IE 6. |
Quote:
Quote:
|
<br /> is valid only in XHTML, because it is an XML-style open/close tag. In XHTML, you must close all your tags, so you could concievably go <br></br>. I don't suggest you use XHTML, as it's a largely unsupported language, a reformulation of HTML as XML. It is not as of this moment, designed to replace HTML, and in fact there is no reccomendation that introduces anything new, other than its architecture. The latest (and final) version of HTML is version 4.01, which is what you should normally use.
The name attribute was not replaced by id; they serve different functions. The id attribute is something for things like scripts (i.e. getElementById) and styles (#textbox) to lock onto, and also can be used for semantics. The name attrubute explicitly specifies a purpose, such as in a form, "email" would be the name you give to the form input for an email address so that a script or browser can identify what information is being posted. In stylesheets, you don't need to use hex numbers. Black and red for example, can be entered in. Also, an RGB value can be used. Standards are great usually. Please though, don't be under the misconception that writing for a standard will make a page easier or better in some way. Often it isn't. |
Quote:
|
Quote:
Quote:
Name was replaced by id in XHTML..... id is only used for images though I think, but it might be used for others also. RGB values can be used, yes. But if someone wants a standard (a.k.a. compliant) website, then they should use standard coding. Am I the only one that has even attempted XHTML? |
Quote:
I write in HTML 4 and XHTML, depending on the site. Just like how many think that validating makes their code 'better', I think a lot of people use XHTML just because it's new and they think they are somehow writing better code. Really though, the X doesn't make you 1337 :) |
Quote:
I write in both also, doesn't mean I'm using XHTML just because it's "new". I use XHTML more than HTML because I prefer to code the XHTML way. XHTML is also easier to read XML data IMHO (since the X means that same in both XHTML and XML). If someone wants to use HTML, let them. If someone wants to use XHTML, let them. I don't see how you can judge people that they use XHTML because it's new. That's like saying everyone is using PHP because it's better than ASP, or ColdFusion. Edit: As Adam said, the W3Schools site link you posted was converted to XHTML. Read why they did it. It's not because it's new either.... |
Time for an example: I have a form, which I will call "contact". It sends an email to me containing a user's name through PHP or Perl or whatever.
Code:
<form id="contact" method="post" action="emailer.cgi">By the way, I wasn't meaning to refer to you when I said that, "I think a lot of people use XHTML just because it's new and they think they are somehow writing better code. Really though, the X doesn't make you 1337 :)." Just to clear that up. W3Schools did it because they could, and because they knew it would have to be done eventually if they were going to preach about XHTML. I believe that page states more about how they did it than anything. I've read it before, but couldn't find it; I think they used HTML Tidy, but they might've done it by hand, I don't remember. Edit: Hooray for typos! I also haven't been clear. I should point out that name can be looked upon as being a replacement for id, and in some specs is deprecated for that exact reason, but it is also absolutely required in certain elements, like form and meta for example. One should never use id instead in these cases. My example is one of the only truly kosher ways to put name in, as forms have always behaved in this manner. Also, one could also use name and id as seperate identifiers for a script should the need arise. |
I skimmed through your posts. Sorry if you asked me something and I missed it.
I am not sure if I am aloud to post links to the site in places like this, so please try not to get me fired. It is for a center for the blind so it is in large print, audio, and braile. http://www.20-200fellowship.org/ I used bgcolor because if I used a stylesheet it would ignore the external stylesheet. I can fix that, but it is a lot faster to just put a bgcolor in the body tag. I only did it once, I think. It is funny that the charts say that someone from Singapore went to my site at about 6 in the morning last night. Hey Brandon or someone with a domain, is it common to find that. I never did anything with the site and search engines, which would be my next question. |
A blind people's institute? Then you really have to go for heavily semantic-based pages and _accessibility_. check this out.
Again, semantics will help you out with search engine spiders. things as simple as <h1> tags for titles will let them know what your page is about for example. |
New question!
What do I do about putting the site on search engines? Does it cost money or do I just submit the link. I saw a thing in the web shell to submit a link to like google and stuff. |
Quote:
http://www.htmlclinic.com has a good META tag generator. I might be wrong on this though. |
search engines don't just throw random urls in and hope that a site comes back.
if your site is linked to sites that are linked to, you will get searched btw: meta tags are semi-useless for actually getting listed/good standing in a search engine. they MIGHT be used as a description of the page, but ultimately, keywords have to be in the content of your document. compliance is good. because your html is compliant doesn't mean it is necessarily structurally sound and all that, but, heh. Also, it'd help LOADS if you actually had provided a link so we could go through your source? Anyway, what needs to be said has been said. Validation is not a be all end all. BUT! Validation is good, and so are standards. If it weren't for standards we'd have to go back to code branching and updating multiple pages for each browser. Its a bit hard to get used to coding "properly" but once you learn how (or if you never learnt the "tagsoup" style of HTML in the first place) all of a sudden, everything works, and validation isn't a huge pain. @adam: a website full of span tags is as bad as a site full of tables. Both are meaningless semantically/structurally. Headings are h1/h2/h3/etc, use <p> for paragraphs, and so on. Spans are just generic containers that don't really hold much value in terms of describing content. Describe the content, and you have style hooks for CSS without having to resort to excessive amounts of classes/IDs BTW: Isn't ridiculous spelt with an i not an e? :D |
I am having some trouble understanding some of this. I interpreted it as saying that I should concentrate on the h1,h2,etc. tags and p tags, but leave out some of the div tags and span tags. I used the div tags though to reposition some stuff on the home page. That is the only place I remember using them. The articles that are on that website are not typed by me. I just put some p and h tags in to make headings, subheadings, and paragraphs from the plain text document of the monthly newsletter. So, anyways, the div and span tags are more for me and for shortcuts to styles, like some of you said.
My webshell has a thing that says to submit a link to search engines. I noticed google and lycos on the list so I might do that, but I wanted to make sure it didn't cost anything and that I don't need coding, like meta tags, for it to work. |
Nice site, a bit on the clean/blocky side, but its easy to read and quick, which I like very much.
A quick glance at your source, I'm willing to say that its fine. It isn't so much that div/span is BAD as it is that you should probably try to use something more appropriate if possible, the way you're using them is fine. (One caveat is assigning stuf like class="left", technically speaking, one day we'll be able to redesign websites by swapping out CSS files, so it would probably be better to use stuff like class="navigation" or class="contentblock" and so on) BTW: why aren't you linking to an external stylesheet? |
Each page in that site does link to an external stylesheet. That is where the tags' styles are defined as well as the classes.
|
http://www.spamrobotics.org/ ?
I see a <style type... in the head of your HTML. BTW: whats with the ·'s in your code? whats wrong with using <ul>'s?! |
I didn't mean my team's website. I am the web master of the 20/200 Fellowship Organization's website. It is a local organization for me. http://www.20-200fellowship.org/
I put that link above somewhere and I was referring to that. |
oops, owned by my fast reading.
|
Any more comments would be helpful, especially the negative ones. Thanks.
|
colors are a little weird. the green and the grey seem to sort of clash.
the navbar, the grey on grey is a little annoying. also, don't have text become bold, either have it slightly change color or be underlined, and have the underline dissapear, or something. |
| All times are GMT -5. The time now is 15:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi