|
|
|||||||
| About Us | Register | FAQ | Members List | Calendar | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
|
Re: Quick HTML Q.
The W3C website (http://www.w3.org/) has the official specs for HTML 4.01 and XHTML 1.1.
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10 |
|
|
|
|
|
#3 (permalink) |
|
Ramsus K
![]() ![]() ![]() Join Date: Mar 2003
Location: Oklahoma
Posts: 461
|
Re: Quick HTML Q.
Check out:
http://www.w3.org/TR/html4/ To learn about HTML and the various elements it supports. Check out: http://www.w3.org/TR/xhtml1/ To learn how XHTML differs from HTML. Check out: http://www.w3.org/TR/xhtml11/ To learn how XHTML 1.1 changes XHTML (basically, if you use XHTML 1.0 Strict, you don't really need to change anything but your DOCTYPE). For older versions of HTML, see: http://www.w3.org/TR/REC-html32 http://www.w3.org/MarkUp/html-spec/ |
|
|
|
|
|
#4 (permalink) |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Quick HTML Q.
If you want something with charts and stuff that're easier to read, you might try....
http://www.w3schools.com/ The latest html standard is xhtml 1.1, but I recommend you use xhtml 1.0 transitional if you want users of ie 5.0 or so to be able to view your site correctly. The w3c validator can also come in handy a lot. -[Unknown] |
|
|
|
|
|
#6 (permalink) |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Quick HTML Q.
xhtml is like html 5. It's just the next version.
The x means it's "extensible," but moreover that it is also valid xml. The main difference is that you can't say <body><p>blah blah</body>.. you have to have the </p> somewhere. Furthermore, you have to "close" br too - this means using <br />. (img is similar.) This site, as an example, uses xhtml. In fact, imho, all sites should be using xhtml - it's kinda like using cdroms not 5.25" disks, or using gasoline instead of deisel. It's just the newest greatest thing. Another example is PHP. It's been using valid xhtml in it's functions (like nl2br) since like 4.0.4. For more information, read the xhtml tutorial on the site I posted. A direct link should be: http://www.w3schools.com/xhtml/xhtml_tutorial.asp -[Unknown] |
|
|
|
|
|
#7 (permalink) | |
|
Ramsus K
![]() ![]() ![]() Join Date: Mar 2003
Location: Oklahoma
Posts: 461
|
Re: Quick HTML Q.
You realize I gave the the links to the latest HTML specs and all of the old HTML specs FROM THE SOURCE, right? They're quite easy to understand if you sit down and start looking over them. I also included XHTML since it's the future of HTML.
It's more strict than HTML, because it's an application of XML, not SGML. This makes it immensely easier for a computer to parse. It is simpler, but more verbose than HTML. However, 100% valid XHTML is 100% valid HTML. If you want more general information see: http://www.w3.org/MarkUp/ Quote:
All elements are now lowercase. This means you can't write A, HTML, or IMG, it _MUST_ be "a", "html" or "img" instead. All attributes (src, href, etc.) MUST be quoted. So you can't write <img src=whatever.jpg >, but instead you have to write <img src="whatever.jpg"> All attributes must have a value. That is, you can't use <input type="checkbox" checked>, but instead need to use <input type="checkbox" checked="checked">. Don't use the name attribute, but instead use id. This was suggested in many places in HTML 4.01's specification. So instead of saying <a name="whatever"> you would say <a id="whatever">. All tags must have a closing tag. For elements like <img> and <br> that have no closing tag, you must either expand them or use /> to show that they're elements with no closing tag. e.g.: <br></br> or <br /> The space before the slash / is for compatibility with HTML. You can't have improper tag nesting. This means that if a tag begins within another element, it must close before the end of that element. <i><b>WRONG because the b tag is in the i tag, but its closing tag is after i's closing tag.</i></b> <i><b> RIGHT, because the inside tag closes before the outside tag.</b></i> You should begin your document with a <?xml version="1.0"?> tag to show that it is XML. All documents must begin with a DOCTYPE declaration. This should be RIGHT AFTER <?xml version="1.0"?> if it exists, or otherwise THE FIRST LINE. You should do this with your HTML documents too. For XHTML 1.0 Transitional, this would be: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Your document's html tag needs to have the xhtml namespace defined using the xmlns attribute. This is <html xmlns="http://www.w3.org/1999/xhtml"> for every version of XHTML. Now a bit on the three different types of XHTML 1.0 and HTML 4.01. Starting with HTML 4.0, the W3C created three specficiations of HTML: HTML 4.0 Strict, 4.0 Transitional, and 4.0 Frameset. Strict doesn't allow deprecated style tags (e.g. the FONT tag or in many cases the WIDTH attribute) and requires you to really use CSS to add style. Transitional allows all of these style attributes that people still use, but mostly for compatibility reasons. Frameset is used with documents that just set up frames (the document you put all of your <frameset> elements into). XHTML 1.0 maintains these same types, only with a stricter syntax. XHTML 1.1 drops transitional and frameset, leaving only strict. Why should you use XHTML? It's based on XML, which many current and future web technologies (and even client side technologies) are built around. It's easier to parse and not make mistakes because of the strict syntax. And, it's meant as a transitional tool for designers moving from HTML to XML. Miss this boat and you'll really be in a bad situation off later on. Besides that, the changes a minimal, and if you wrote good HTML code before, you shouldn't have a problem switching to XHTML. Last edited by RamsusX; September 24th, 2003 at 14:19. |
|
|
|
|
|
|
#8 (permalink) |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Quick HTML Q.
While you did link to the source, it's also true that those are technical documents. I can read them fine, as I'm sure many other people can who've been working with HTML for a while... but a lot more people can't - or, more importantly, don't want to. (considering their length.)
The website I linked to gives the information in a simplified manner. It also has a REFERENCE CHART, (showing which versions of the DTDs certain elements work in - S, T, and/or F.) which the World Wide Web Consortium has not chosen to provide. And, my apologies for the unclearness - I forgot that HTML is enabled on this forum. (which makes it very annoying and difficult to show it properly, oops.) But, yes, that is a better and more complete summary of the changes - although many of them have been, technically speaking, "rules" all along, like quoting values of attributes. I'd also like to note that using the xml PI (processing instruction, the thing in <? ?> - I say this for Solid_Snake and other's understanding.) is not strictly required. As they say, "an XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents." -[Unknown] |
|
|
|
|
|
#9 (permalink) |
|
Ramsus K
![]() ![]() ![]() Join Date: Mar 2003
Location: Oklahoma
Posts: 461
|
Re: Quick HTML Q.
You can use &lt; and &gt; to create < and >.
I was talking to Solid_Snake, when I was speaking about the links I gave, in case he wasn't familiar with the W3C and its efforts. I understand w3schools.com has some nice reference and tutorial material on their site. I was not trying to downplay their relevance or usefulness. Indeed, he will likely find their references more suitable for his purpose. Also, I only said that you should have an XML declaration. I didn't mean to imply that it was necessary. As a side note, I also left out something important. Whenever you have & in an XHTML document, even in a URI as part of an href or src attribute, you should replace it with &amp; since & is an escape character of sorts used for specifying characters that usually require a character map(© using &copy;) as well as those with a special meaning (&, <, >). BTW, here's an example XHTML 1.1 with CSS layout for reference: http://www.chronocompendium.com/layout1/ I'll probably replace the div elements with tables as I implement the new Content Management System I'm writing for that site. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|