HTML: Introduction to HTML

0 21
Avatar for DeeperThanWeb
3 years ago

The HyperText Markup Language, or HTML, is a scripting language used to create Web pages for the World Wide Web (WWW). Essentially, HTML is a text file that is “marked up” with codes often referred to as tags. Tags tell the Web Browser how to display Web page elements such as text and images in the Web browser window. HTML reminds Web browsers were to make paragraph breaks when to change font color and sizes, where to insert a picture, as so forth. Without the HTML tags, the Web browser would display the documents as a regular text file with no images or formatting.

An HTML page contains HTML tags, which are embedded commands that supply information about the page's structure, appearance, and contents. The documents themselves are plain text files (ASCII) with special "tags" or codes that a browser knows how to interpret and display on your screen. These tags are called Container, which has two types: Container tags and Empty tags. Both types of tags offer tag Attributes. Tag Attributes are options that affect or enhance the way the tag displays content in the Web browser window. Tags and attributes work together to identify parts of the document and how the Web browser should display them.

The < > and < / > are called Angle Bracket. All tags are comprised of angle brackets. The angle brackets tell the browser that the text between them is an HTML command. The HTML commands contain text or other Web page elements and tell the Web browser how to display them. Thinking of tag-sets, as containers will help in another way. It will help you remember that tags should always be balanced. In other words, you should keep containers nested within each other, just as you would have to do in the real world. Let's try some visual examples where we draw the containers:

Why should you worry about this? Well, if you start overlapping containers as shown on the Figure 1, about the best you can expect is that the document will be formatted in unexpected ways.

One more thing to keep in mind with regards to containers, since HTML is based on these structures, it is often the case that the arrangement of text within a container is irrelevant. For example, within a paragraph container, all of the text can be in one long line, or in a series of separate lines, or with every word on its own line. These would all be displayed exactly the same.

Therefore, try to keep in mind this thought: whitespace doesn't matter

Container Tags

Container tags require an < > open tag and < / > closing tag; in other words, one tag turns the HTML command on, and the closing tag turns it off. This tells the browser when to begin the command and when to end it. Most of the tags that you will be using will be container tags. Container tags are more command because HTML formats elements as a whole.

Empty Tags

Empty tags do not require a closing tag. An empty tag executes an HTML command that embeds an element all on its own. Once you type the tag to execute a specific HTML command, the browser reads the command and executes it.

Attributes

Attributes are options that affect or enhance the way the tag displays content on the Web page. An attributes is made of three components: the name of the attribute, the = sign, and the value of the attributes. Attributes are optional parts of tags that add more detail to the content they contain.

1
$ 0.02
$ 0.02 from @TheRandomRewarder
Avatar for DeeperThanWeb
3 years ago

Comments