WebPulse Forum
The default language of any content posted is English. Do not create multi-accounts, you will be blocked! For more information about rules, limits, and more, visit the Help page. Found a dead link? Use the report button!

Overview of HTML!

HIT "OVERVIEW" TO LIKE RESOURCE & ACCESS DOWNLOAD

CYBE

owner
Administrator
Moderator
Credits
17,559,716
HyperText Markup Language, or HTML, is the standard markup language for describing the structure of documents displayed on the web. HTML consists of a series of elements and attributes which are used to mark up all the components of a document to structure it in a meaningful way.

HTML documents are basically a tree of nodes, including HTML elements and text nodes. HTML elements provide the semantics and formatting for documents, including creating paragraphs, lists and tables, and embedding images and form controls. Each element may have multiple attributes specified. Many elements can have content, including other elements and text. Other elements are empty, with the tag and attributes defining their function.

There are several categories of elements, including metadata, sectioning, text, inline semantic, form, interactive, media, component, and scripting. We'll cover most of these in the series. But first, what is an element?

Elements​

HTML consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear or act in a certain way. HTML elements are delineated by tags, written using angle brackets (< and >).

Our page title is a heading, level one, for which we use the <h1> tag. The actual title, "Machine Learning Workshop", is the content of our element. The content goes between the open and closing tags. The entire thing—the opening tag, closing tag, and the content—is the element.

<script class="js-extraPhrases" type="application/json"> { "lightbox_close": "Close", "lightbox_next": "Next", "lightbox_previous": "Previous", "lightbox_error": "The requested content cannot be loaded. Please try again later.", "lightbox_start_slideshow": "Start slideshow", "lightbox_stop_slideshow": "Stop slideshow", "lightbox_full_screen": "Full screen", "lightbox_thumbnails": "Thumbnails", "lightbox_download": "Download", "lightbox_share": "Share", "lightbox_zoom": "Zoom", "lightbox_new_window": "New window", "lightbox_toggle_sidebar": "Toggle sidebar" } script>
The tags and content that make up an HTML element.


The closing tag is the same tag as the opening tag, preceded by a slash.

Elements and tags aren't the exact same thing, though many people use the terms interchangeably. The tag name is the content in the brackets. The tag includes the brackets. In this case, &lt;h1&gt;. An "element" is the opening and closing tags, and all the content between those tags, including nested elements.



&lt;p&gt;This paragraph has some<br> &lt;strong&gt;&lt;em&gt;strongly emphasized&lt;/em&gt;&lt;/strong&gt;<br> content&lt;/p&gt;<br>
This paragraph element has other elements nested in it. When nesting elements, it's important that they are properly nested. HTML tags should be closed in the reverse order of which they were opened. In the above example, notice how the &lt;em&gt; is both opened and closed within the opening and closing &lt;strong&gt; tags, and the &lt;strong&gt; is both open and closed within the &lt;p&gt; tags.

Browsers do not display the tags. The tags are used to interpret the content of the page.

HTML is very, very forgiving. For example, if we omit the closing &lt;/li&gt; tags, the closing tags are implied.



&lt;ul&gt;<br> &lt;li&gt;Blendan Smooth<br> &lt;li&gt;Hoover Sukhdeep<br> &lt;li&gt;Toasty McToastface<br>&lt;/ul&gt;<br>
Although it is valid to not close an &lt;li&gt;, it isn't good practice. The closing &lt;/ul&gt; is mandatory. If the unordered list's closing tag is omitted, the browser will try to determine where your list and list items end, but you might not agree with the decision.

The specification for each element lists whether the closing tag is mandatory or not. "Neither tag is omissible" in the specification means both an opening tag and a closing tag are required. The specification provides a list of all the required closing tags.

If the &lt;em&gt; or &lt;strong&gt; in the example earlier had not been closed, the browser may or may not close the element for you. Not closing an &lt;em&gt;simply leads to content possibly being rendered differently than you intended. If a &lt;/ul&gt; is omitted and the next tag is a closing tag for the list's parent container, you're lucky. If, on the other hand, it's an opening &lt;h1&gt; tag, the browser will assume the header is part of the list, including inheriting styles. Some omitted closing tags cause bigger issues: not closing some tags, such as &lt;script&gt;, &lt;style&gt;, &lt;template&gt;, &lt;textarea&gt;, and &lt;title&gt;, breaks subsequent content as shown in the following example.
 
Back
Top Bottom