RU beehive logo ITEC dept promo banner
ITEC 325
2018fall
ibarland

well formed xhtml
some basics

terms

Just reviewing a few terms you learned these back in Web I:

And, here are further examples that also include an entity:
labeled examples of tags, attributes, attribute-values, and entities (and, text) When talking with other people in the field, it’s important you use these terms correctly.

video (18m55s)

good practices

Even though original HTML always doesn't require the following, they are best practices, and they are required for this class:

Special tags, attributes, and entities

attributes

entities

Most HTML entities are merely names for special characters (like — for “—” or ≤ for “≤” or … for “…”).

However, there are five essential entities defined in XML itself, necessary to distinguish between content and the (xml) markup itself:

The most important is lt; the others can usually be distinguished by context3. But just because browsers handle the incorrect markup, doesn't make it right.

Another place these entities might occur is in URLs, like http://some-site.com/some-page's-weird-stuff.html.

relevent: A URL — especially if it refers to a filename — might have characters which confuse it with syntx-for-URLs. In particular, a space or a slash (/), but also URL-specific characters like ?, =, , (used to encode GET parameters). In these cases, one will use a character-encoding that involves the numeric unicode: rather than http://websearch.com?word1=why?&word2=M&M's&word3=spacecase you would use http://websearch.com?word1=why%3F&word2=M&M's&word3=space%20case

tags (“elements”)

There are two particular HTML tags that don't actually mean anything by themselves(!). They are purely used for grouping (kinda like parentheses):

They’re useful since you can attach a class/style attributes to them (or event-handlers like onclick, etc.).

See Also

See also:


1 Well, you can also have “<div hidden=''>”, which means the attribute is present/true(!). I suggest not using an explicit-empty-string. The only reason this allowed as a value is that HTML5's convention is that “<div hidden>”. is shorthand for<div hidden=''>”. Sigh.      
2 Well, xhtml is almost always valid HTML. One notable counterexample is the already-mentioned “<script src='somefile.js' />”, which is a closed tag in xhtml, but an unclosed tag in HTML5 [shakes fist at sky].      
3 Morever, browsers often treat < followed by a space as the less-than-character rather than start-of-tag.      

logo for creative commons by-attribution license
This page licensed CC-BY 4.0 Ian Barland
Page last generated
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.