So anyway, I'm kind of new to HTML... well, not exactly new... I learned HTML back when it was very different... back when all tags were done in caps and closing tags on single-tag elements weren't needed and there was no CSS (example:
I learned:<CENTER><IMG SRC="http://www.google.com/images/srpr/logo3w.png"></CENTER>
Instead of:<img style="display:block;margin-left:auto;margin-right:auto;" src="http://www.google.com/images/srpr/logo3w.png" />
However, I've learned just about all the differences so it doesn't really matter.
I am confused about a few things though...
Actually, you were never required to use all-caps for HTML tags in the past - it was kind of a (poor) convention to help in noticing the differences between tags and content. HTML itself is actually case-insensitive.
First, what is the difference between XHTML and well marked-up HTML besides the DOCTYPE and the fact that instead of writing <html> you write <html xmlns="http://www.w3.org/1999/xhtml"> and the fact that a few HTML attributes are not included in XHTML? Are the two compatible... I mean could I literally take my web page and change the DOCTYPE and the <html> tag and have it work as XHTML (as long as I haven't used any attributes that aren't valid in XHTML)?
XHTML is an effort to bring HTML into a more XML-like strictness to ease document parsing because properly-formatted XHTML documents can be parsed by XML parsers, whereas traditional HTML requires a unique processing engine. The xmlns attribute included in the HTML tag defines the XML namespace for the document. Simply changing the DOCTYPE wouldn't break the function of your page, but it would not necessarily parse well with an XML parser -- which is what the W3C Validator exists to show. Selecting your DOCTYPE is only a matter of opting to go with a specific standard.
Also, what really is the point of HTML when XHTML exists? It sounds as if XHTML is better, so why should I ever use HTML?
Just varying standards. The web is kind of a mess right now, really, and it's easier to teach proper HTML before covering XHTML.
Second, I'm confused about DOCTYPEs as they didn't exist when I learned the language. I see that there's strict, transitional, and frameset... I don't understand the purpose. If I write code that follows the strict standards and I give it the frameset DOCTYPE then will it still run fine? If so, what's the point in even using strict if frameset allows for strict along with other stuff?
See my above response regarding XHTML. You should never,
ever use frames anymore, they're disgusting little practices that are worse (in my opinion) than scrolling marquees.
Third, there's this "validator" program at http://validator.w3.org/ ... I assume that what that does is checks the code for errors. However it always finds a ton of errors in my code that I know are not errors at all. In fact, giving it Google as the page to check gives 32 errors and there's no way that there could be that many as it runs fine for everyone who uses it. It also tends to find tons of errors in my javascript scripts saying that they aren't valid HTML (but of course they aren't valid since they aren't HTML). Should I ignore those errors... more importantly should I ignore this validator altogether?
The errors it finds (as I mentioned earlier) are related to how well your document follows your selected standard. They may not cause rendering issues (though they might across various browsers), but it's still a matter of improper formatting. Basically, the biggest thing to look for is making sure that you aren't using deprecated tags (such as <center>), leaving formatting such as that to CSS documents (in that specific case, align: center), and making sure that you're closing standalone tags (such as
and <img />).
Lastly, I'm curious... what would an older browser do when it comes across a tag that didn't exist at the time? Will it ignore the tag or will it print the tag to the page as if it was text?
Depends on the browser. Usually, it'll simply ignore them. Still, most of what you'll use will be recognized by any semi-modern browser -- I think the oldest you'll ever have to deal with is Internet Explorer 6, and even the U.S. military has moved on to IE7 and newer. (Take it from my experience, that is a
huge deal. <_<)