Читать книгу HTML5, JavaScript, and jQuery 24-Hour Trainer - Cameron Dane - Страница 11

Part I
HTML and CSS
Lesson 1
Introduction to HTML5
What Is a Markup Language?

Оглавление

A markup language is a language for annotating a document with a set of tags. These tags are used to provide additional meaning and structure to the text of the document, or provide instructions on the manner in which it should be displayed to the reader.

For instance, a tag may state that one portion of the text is a header, while another portion is a paragraph of text. Consider the following document fragment:


In this example, the tags can be clearly differentiated from the content of the document by the angle brackets. The following represents the start of a heading:


while this represents the end of the heading:


Note

HTML defines six categories of header from h1 to h6. The lower the number, the more important the header is.

The entire h1 structure – including the start tag, the end tag, and its textual content – is referred to as an element.

The HTML5 markup language specifies the tags that can be used in an HTML document, how they should be used, and what additional information (called attributes) they can contain.

In the early days of HTML, many of the tags included in the markup language instructed the browser how to present information. For instance, tags were used to dictate font size and color.

The HTML markup language is no longer responsible for dictating the presentation of a document, and in HTML5 most of the remaining presentation tags have been removed. Presentation is now the sole preserve of another technology called Cascading Style Sheets, which will be examined later in this section.

Instead, the HTML5 markup language is responsible for conveying the meaning of the various components of the document and how they interact with other components.

Note

Browsers can still provide their own default styles for tags, however, and this is why an h1 element will appear in large, bold text.

HTML5 greatly enhances the expressiveness of earlier version of HTML, however, and allows sections of the document to be marked as, amongst other things, headers, footers, and asides.

Earlier versions of HTML were based on a technology called SGML, which is a language for expressing markup languages. As of HTML5, the HTML markup language is not based on any other technology. This has removed a number of restrictions from the language; therefore, if you are familiar with HTML, you will notice in the sections that follow that a number of the old rules no longer apply.

HTML5, JavaScript, and jQuery 24-Hour Trainer

Подняться наверх