Editing 1144: Tags

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 12: Line 12:
 
{{w|HTML}} is a markup language used in the development of websites, and is the subject of this comic. Most distinct elements of a webpage – like this paragraph of text, the title of this section, or the logo in the top-left of this page – are enclosed in HTML tags which describe the type of object they are. The comic employs multiple poor HTML practices while asking the rhetorical question of how best to annoy web developers, effectively answering the question that it poses.
 
{{w|HTML}} is a markup language used in the development of websites, and is the subject of this comic. Most distinct elements of a webpage – like this paragraph of text, the title of this section, or the logo in the top-left of this page – are enclosed in HTML tags which describe the type of object they are. The comic employs multiple poor HTML practices while asking the rhetorical question of how best to annoy web developers, effectively answering the question that it poses.
  
In HTML, all elements (except self-closing elements like <code>&lt;img&gt;</code>) should consist of an open and close tag of the same type <code>&lt;div&gt;Like this&lt;/div&gt;</code>.
+
First, in HTML, all tags should be matched with both an open and close tag of the same type <code>&lt;div&gt;Like this&lt;/div&gt;</code>. Before HTML 4.01, all tags were uppercase (technically elements were uppercase and attributes were lowercase "to improve readability" [http://www.w3.org/TR/1998/REC-html40-19980424/about.html#h-1.2.1]) to make it easier on the browser to parse what was markup and what was content on the page. As is the case with nearly every change to the HTML specification, many developers slowly got lazy and stopped making every tag uppercase forcing browser developers to check for both upper and lowercase as they parsed the markup. When the specification was bumped to XHTML 1.0 it stated that no one should use uppercase tags any more, everything should be lowercase.
  
HTML (except in its formulation as an XML language—XHTML) has never been case-sensitive, but the practice of using uppercase tags for readability is long outmoded, and the mixing of cases in this example would definitely annoy a developer.
+
Another basic idea of HTML is that all tags, or elements, must be properly nested — although they have slightly different meanings, the words "elements" and "tags" are generally used interchangeably. That is, anything inside a div must be closed before the div is closed.
 
 
Another basic idea of HTML is that all elements should be properly nested. That is, any element whose open tag occurs inside a div must be closed before the div is closed.
 
 
 
NB: In practice, web browsers will error-correct nearly all these problems.
 
  
 
{| class="wikitable" |
 
{| class="wikitable" |

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)