Saturday, November 21, 2009

Really Cool HTML Code

Across the Web, millions of users and professional Web developers work with Web pages daily. To simplify their efforts, many Web developers rely on numerous Web development software programs to help them with Web page design. Unfortunately, to exploit new Web technologies fully and to drive Web site performance, developers must at some point roll up their sleeves and dig into some really cool HTML code, Cascading Style Sheet rules, JavaScript, Active Server Pages, PHP, and more. Despite the vast number of sites that make up the World Wide Web, you would be hard pressed to find a Web developer who would not be happier if his or her site were faster, more secure, or easier to manage. Further, the users who visit sites not only want entertaining and current content, but also want that content to download quickly. Most users assume that the sites that present themselves as secure truly are secure. Regardless of the content you place on a Web site, users expect quality, speed, and security.

HTML text documents are actually quite simple to create. To create an HTML document, you open a text-editing program and then type in the HTML code. After you have entered the HTML statements, you save your document as a text file with an .htm or .html extension. For example, start your favorite text editor (such as Windows Notepad) now, and enter the following really cool HTML code:

Example of a Simple HTML Document

HELLO WORLD! Here I am.

Now, save your work to a Web page file (that is, a file with an .htm or .html extension) on your hard drive. Then, save the code you entered for this example as TestPage.htm in the folder you create. To take your first Web page for a test drive, start your Web browser, and type File:// followed by the drive letter and pathname of your Web page into the browser's Address field. For example, if you saved the Web page in this example as TestPage.htm in the C:\HTML folder, type File://c:/HTML/TestPage.htm into the browser's Address field. Then, press ENTER. Your Web browser, in turn, will display a Web page. That is all there is to it! You are now officially a Web page author. That is pretty cool, right?

In standard word processing, a paragraph defines a group of sentences. Typically, a blank line or an indented first word identifies the start of a new paragraph. When you insert text into a Web page, the tag controls the end of text and the subsequent beginning of the next paragraph. The

tag instructs the Web browser to move down one line, insert a blank line, and then to begin the next paragraph on the line below the blank line for the text following the tag. In this following code, the start and end paragraph tags () mark the beginning and end of each paragraph.



Welcome to Lots of Text

The text between the two paragraph tags defines a single paragraph. Paragraphs contain one or more sentences.

The next paragraph starts here with a blank line inserted between the two paragraphs

HTML also has several text formatting tags you can use to change the appearance of text, usually for emphasis. To apply a formatting style, place the format's start tag at the beginning of the text you want to style. The following list describes three of the most common formatting tags.

  • Text placed between the Bold tags is displayed in bold font.
  • Text placed between the Italic tags is displayed in italic font.
  • Text placed between the Underline tags is displayed with an underline.

The following really cool HTML code displays text in the bold, italic, and underlined style.

Welcome to Basic Font Styles.

This text displays bold

This text displays in italic

This text displays underlined

You insert one or more attributes in an HTML tag to give the Web browser additional information about the way in which the browser is to carry out the tag's instruction. For example, a tag tells the Web browser you want to change the appearance of the text that follows the tag. The color and face attributes that follow the tag's name in the following code tell the browser the color (red) and typeface (Helvetica) that the browser is to use in order to change the appearance of the text that follows the tag:

This text is red, Helvetica text.

Attributes, which you always insert after the tag's name in either start tags or empty tags, consist of three components: the attribute's name, followed by the equal sign (=), followed by the attribute's value enclosed in quotes-either double ("") or single (''). The Web browser will continue to apply the attribute(s) you specify within a start tag until the browser reads the associated end tag. In this example, the Web browser will continue to make text look as specified by the color and font attributes in the tag until the browser encounters the tag in the Web page HTML.

By the way, the Web browser ignores any spaces you place on either side of the equal sign (=) between an attribute and the attribute's quoted value. As such, you will see some Web documents with no spaces (as shown by the HTML statement in the preceding example) and some documents with spaces on either one or both sides of the equal (=) sign. When writing your HTML tags, select whichever looks best to you; just be consistent.

When you want to assign the same set of attributes to several adjacent Web page elements at once, enclose the elements you want to affect with start and end division tags (). Say, for example, that you want to center two lines of text and a graphic image between the left and right margins on the Web page. Rather than add the align attribute to each of the three HTML tags, place a tag before the first element and a tag after the end of the last element, as shown in the following code:

This text is centered ABOVE the picture.


This text is centered BELOW the picture.

The tag lets you assign one or more formatting attributes to a group of HTML tags. The tag instructs the Web browser to again use the default values for attributes specified in the tag.

This is some really cool HTML code for you to get a good picture of this web language.It's very interesting that you can use HTML in more platforms, and you can use it even when you design your own iPhone applications, or when you just create your own Web page. Take a look at the coolest free Apple apps, and combined with the information here, maybe you will create some cool iPhone applications.

No comments:

Post a Comment