An Introduction to HTML Code
HTML, short for HyperText Markup Language, is a form of code that programmers use to create the Web pages that the Internet now relies on for mass communication. While some content exists in alternative forms such as Shockwave Flash or Java, the majority of Web pages and websites primarily rely on HTML code to display information due to its relative ease of use. Most online content is made up of plain-text files called HTML documents. HTML documents mainly consist of a combination of human-readable content arranged into a specified layout with the use of tags. Tags are the actual code or commands that determine the layout of a page, like the code used by traditional desktop publishing software. Unlike desktop publishing software, which uses underlying code that is not readable by humans to arrange content, HTML tags are a form of plain-text code, or underlying code that is readable by Web page designers. Newer desktop publishing programs also help designers automate the creation of Web pages and even entire websites. However, at some point, most Web designers will find themselves needing to understand HTML code in order to make the best use of HTML’s powerful layout features.
Basic Structure of a Web Page
The typical Web page is highly structured. It starts with a header tag, the <html> tag, which instructs Web browsers to treat the incoming text file as an HTML document. At the end of the HTML document, the <body> tag marks the end of the layout information and counts as the end of the file when it’s being read by a Web browser. Web documents also traditionally contain other header-class tags such as the <meta> tag, which provides information about the Web page. This information includes things like the page title, which is defined by the <title> tag. A properly designed page will then include the <body> tag, after which all human-readable content is arranged into its proper layout by the use of additional HTML tags.
The structure of HTML code dictates that almost all HTML tags are paired up, which means that they begin with an opening tag such as <div> or <span> and they must be closed by using a closing tag, like </div> or </span>. In the case of nested tags, such as the header and title tags, the first tag should close last, as in <head><title>This is the title</title></head>. All HTML tags are enclosed by greater-than and lesser-than characters, < >. This indicates to the Web browser that it is receiving layout commands rather than actual human-readable text.
Common HTML Tags
Content within the Web page is typically arranged by the use of very common formatting and paragraph tags. These include the paragraph command, or <p> tag. After this tag, traditionally, a Web designer will place some human-readable text, then end the paragraph with a </p> closing tag. Text-formatting tags like <strong> bold and <em> for italics are useful for modifying text. It is also possible to give text different font faces by enclosing text within <font> tags. Web page content also traditionally uses human-readable headline text, which is larger than regular text and provides titles for sections of content within a page. These header tags are not the same as the <head> tag, however, as they are actually visible and appear within the readable content itself. The largest header text is defined by <h1>, while <h2> and <h3> (and so on) produce smaller text headers.
Modifications to the <background> tag can add a background image or change the background color of a page. For a background color, use the format #RRGGBB, where RRGGBB is a color code in RGB format. For instance, the color code “#FF0000” would produce a pure red background.
The image tag, which places pictures within Web pages, is <img src=”http://imageurl.com/image.jpg” /> and does not need a closing tag. The IMG command can also define the height and width of an image. For instance, <img src=”http://imageurl.com/image.jpg” style=”height:100px; width:200px” /> will place an image and resize it to 100 vertical pixels by 200 horizontal pixels.
- Commonly Used HTML Tags
- A Summary of HTML Codes
- The HTML Programming Language
- A Glossary of HTML Tags
- What Exactly is HTML?
- What is HTML? HTML Tutorial
- HTML: Basic Tips for Coding Your Web Pages
- A Very Simple Web Page
- Some Basic HTML Codes (PDF)
- Basic HTML Codes
- HTML Tutorial (PDF)
- HTML Basics (PDF)
- Texas A&M University: Basic HTML Code
- Basic HTML Cheat Sheet (PDF)
- HTML Guide
- Generating Colors in HTML
- HTML Structure
- Basic HTML Structure (PDF)
- HTML Survival Kit: Basic HTML Structure
- Introduction to Web Design: HTML Links
- Page Structure
- HTML Tags
- How to Make Relative Links
- Style Tags and Basic HTML
Are you a technology reseller?
Our partner program is designed specifically for integrators like you.