Creating Android Apps 3

5:26:00 PM |


The body and head are always wrapped in an html element. Example1-3 shows the snippet in the context of a proper HTML document. For now the head section contains
a title element, which tells the browser what text to display in the title bar of the window.
Example 1-3. A proper HTML document
<html>
<head>
<title>My Awesome Page</title>
</head>
<body>
<h1>Hi there!</h1>
<p>Thanks for visiting my web page.</p>
<p>I hope you like it.</p>
<ul>
<li>Pizza</li>
<li>Beer</li>
<li>Dogs</li>
</ul>
</body>
</html>
Normally, when you are using your web browser you are viewing pages that are hosted on the Internet. However, browsers are perfectly good at displaying HTML documents
that are on your local machine as well. To show you what I mean, I invite you to crack open a text editor and enter the code in Example 1-3.Picking the Right Text Editor
Some text editors are not suited for authoring HTML. In particular, you want to avoid editors that support rich text editing, like Microsoft WordPad (Windows) or TextEdit
(Mac OS X). These types of editors can save their files in formats other than plain text, which will break your HTML. If you must use TextEdit, save in plain text by choosing
FormatMake Plain Text. In Windows, use Notepad instead of WordPad.
If you are in the market for a good text editor, my recommendation on the Mac is
If free is your thing, you can download Text Wrangler for Mac. For Windows, Notepad2 and Notepad ++ are highly regarded. Linux comes with an assortment of text
editors, such as vi, nano, emacs, and gedit.
When you are finished entering the code from Example1-3 , save it to your desktop as test.html and then open it with Chrome by either dragging the file onto the Chrome
application icon or opening Chrome and selecting FileOpen File. Double-clicking test.html will work as well, but it could open in your text editor or another browser,
depending on your settings.
Textmate. There is a clone version for Windows called E Text Editor.

0 comments: