First, give me a very quick summary of HTML.
HTML stands for “Hyper Text Markup Language” and it is the language that browsers understand in order to construct and display web pages. It’s not a programming language, so you can’t perform sophisticated loops, if statements, or construct “objects” with methods. Chances are that you will have some sort of graphical tool to create web pages through a slick user interface rather than by hand coding HTML. So taking the time to learn the language thoroughly is questionable unless you are a developer of some sort . However, there are some basic concepts of HTML that are important to understand if you’re going to have any exposure to it at all.
An HTML document contains the text that goes on a given web page along with all the instructions for how to display that text – in tables, in bulleted lists, in italics, etc. For example, when your browser receives (for the ten thousandth time) the string “<p><b>Victoria’s Secret</b></p>”, it knows to start a new paragraph and to display the text “Victoria’s Secret” in bold. The opening “<b>” and closing “</b>” strings tells the browser to highlight the text in between in boldface. Similarly, the opening and closing set of Ps (P is for “paragraph”) tell the browser to insert a blank line before and after the text. Such special “tags” are not displayed on the web page itself, but are instructions to the browser on how to format and display the rest of the information coming across. Closing tags are the same as opening tags except they have a forward slash at their beginning.
Give me 4 sentences or less explaining tags
Then there’s a whole bunch of special tags defined by the HTML standard. Tags exist to create the web page title (“<TITLE>”), center text (“<CENTER>”), change the font (“<FONT>”), create tables with cells of information (“<TABLE>”), create bulleted lists (“<OL>”), create hyperlinks to other pages (“<a>”), and embed images in the page (“<IMG>”) just to name a few. You can also create objects intended to gather information and send it back to the server. Text entry fields, buttons, or checkboxes, for example, are created with the “<INPUT>” tag.
Can you pass a tag parameters?
Some tags take parameters. For example, when embedding an image, you have to tell the browser the name of the file that contains the graphics to be embedded on the page. That is, you can’t just say <img> and expect the browser to know what image to place there. Rather, you specify what image should be placed at this point by adding the appropriate “tag parameter”, like so:
<img src = http://www.congress.gov/images/109thCongress/ChristmasParty/caughtInCrapper.jpg>
Tell me very fast about the main parts of an HTML document
This string appears in the top frame of the browser. Look here!
Last night I stayed up all night playing poker with tarot cards. I got a full house and four people died. -S. Wright
If you enter these lines into a file and then drag and drop that file into a browser, it will look like this:
The white space and tabs in the HTML source above is ignored. (Development tools and developers alike are notorious for not making source code easy to read. You can’t even get most developers to take a shower, let alone to keep their source code neat. )
How does HTML differ from this XML I've been hearing about?
HTML is often confused with related technologies such as XML, XHTML or HTTP. XML is not the parent or child of HTML – it’s the sibling. XML and HTML look very similar, but they have different purposes. HTML is about displaying text while XML is about holding data in an organized format for easy parsing. HTML contains only tags defined by the official standard. XML on the other hand, lets users make up their own tags so their data can be put in a form that is self-describing. HTML is understood by browsers but XML is understood by custom programs that recognize the meaning of the tags invented by developers. An XML document might look like this:
<Subject>Pack Your Bags</Subject>
<MemoContent>…and the horse you rode in on.</MemoContent>
The opening and closing XML tags look just like opening and closing HTML tags. Some browsers can display XML documents in an organized fashion (try dragging and dropping one into your browser), but a browser doesn’t really understand what to do with company memos. By contrast, a browser knows exactly what the “<b>…</b>” HTML tags mean – to perform the action of bolding the enclosed text.
So what's XHTML?
Extensible HyperText Markup Language (XHTML) is really just newer version of the HTML standard and is almost indistinguishable from the HTML 4.01 standard. XHTML changes the HTML syntax slightly to conform to commonly used XML practices or even XML standards. (Your web pages are probably already in XHTML but developers may still imprecisely refer to the source as HTML.) For example, old HTML allowed you to omit the closing “</html>” tag. XHTML does not allow such laziness and requires that you include all closing tags so that your HTML can be processed by XML parsing code.
What's the difference between HTML and HTTP?
Even seasoned developers sometime say HTML when they mean HTTP, and vis-versa. HTML is the standard for how web page information will be displayed while HTTP is the standard for how web page information will be transmitted, so the distinction is subtle. When information destined to a browser or to a web server is transmitted, it’s HTTP while it is on the wire, even though HTML is ultimately inside that request. When it’s unpacked, it’s HTML again. In addition to transmitting HTML, HTTP can also send graphics, sound files, XML files and other file types.
So what are the key technologies that accompany HTML and why are they needed?
HTML was invented a long time ago and the demands for fancy user interfaces have increased many times over. Consequently, the IT industry has compensated for a number of HTML’s shortfalls with all kinds of augmenting technologies. For example, HTML provided only weak support for dynamically constructing web page information based on database values. Java Server Pages (JSPs), Microsoft’s Active Server Pages (ASPs), PHP, CGI, Python, Ruby, Flash, and a host of other technologies were introduced to blend traditional programming constructs (like “if-then” statements) directly with the HTML, allow for database access, and to add support for impressive graphics.
Very quickly then - what are Cascading Style Sheets (CSS)?
HTML by itself does not provide mechanisms to ensure all the web pages for a given web site have a consistent look and feel, so the technology of Cascading Style Sheets (CSS) was introduced. Style sheets allow web developers to establish cross-page consistency in font, background color, bulleting, indentation, and other visual attributes. CSS separates the text and image content from the artistic design of the site (fonts, image placement, etc.) A single HTML file can be associated with several different CSS files so that the same HTML file can appear different depending if it’s being displayed in a desktop browser, from a cell phone, or when destined for a printer.
The HTML-augmenting technologies are countless. Just a few of these are:
- Active X – A way of attaching programs to a web page so that it is downloaded to the browser machine and run locally (it has to be a Microsoft operating system machine). This provides web pages with all the features of a local program, albeit at the cost of potentially compromised security. To compensate for this hole in security, the browser prompts “Are you sure you trust the guys who own this web site? They seem pretty shady to me.” before it runs the program.
- Applets – Conceptually the same as Active X, although applets solve the security problem in a different way. With applets, access to the disk drive is simply disallowed. Applets are no longer widely used as a number of other industry standards have replaced them.
- Cascading Style Sheets (CSS) – CSS augments the vocabulary of HTML to allow colors, fonts, and text placement to be consistent across all web pages in a company. CSS is used, for example, to ensure the title and graphics at the top of a corporation’s web pages are consistent. (Go to http://www.csszengarden.com to see how the same web page can be dramatically transformed by different style sheets . Just click on the links on the right hand side of the page to apply different style sheets to the same web page.)
- Flash – A widely used product by Adobe that gives web pages animation that can even respond to user clicks and keystrokes.
- XSL (Extensible Style Sheet Language) – A language used to specify how XML data files should be displayed in a browser (that is, converted to HTML). Even though most browsers can already display XML files, the resulting web page is crude. XSL tells the browser how to display the data fields in an XML file. With XSL, you can force the browser to use certain fonts, colors, indentation, or even tables to display a given XML file. This is very useful if, for example, you have a catalog of products in XML format and you want to convert that entire XML file into something that looks respectable on the web.
So is HTML easy to read?
HTML rapidly becomes unreadable as the page’s complexity increases. To see this for yourself, go to your favorite web page , and, from Microsoft’s Internet Explorer, select from the pulldown menu “View” and then “Source”. This option displays the HTML source for the web page you are on. It’s undoubtedly pretty cryptic. It will give you a headache. Any Microsoft Word document can be saved as an HTML file. Try turning one of your Word documents into a web page and see how complex it is. (You can drag and drop the resulting HTML file into a browser to see how it will look when served out from the web server.) You really need a tool like Adobe Dreamweaver or Microsoft FrontPage to be able to effectively navigate an HTML file.
What are the common mistakes that companies make even after all these years with HTML?
HTML is a pretty widely used and understood technology. On the other hand, think for a moment about the top three most common and most costly mistakes that companies make with HTML. They make those mistakes all the time. If you’re drawing a blank or only thinking about minor HTML annoyances then it might be worth a few bucks to order the book now and get the full picture. Don't just settle for the excerpt above - our book is chocked full of common mistakes that companies make on HTML and on a lot of other technologies too. A few dollars spent today might save you a lot of headaches in a few months. (At the very least, the book comes with a number of cartoons, which, according to my dogs Wrecks and Lucy-fur, are hysterical.) Leverage off our "school-of-hard-knocks" experience and click the “Buy Now” button below!