HTML Element Basics Learning

Source: Internet
Author: User
Tags closing tag

HTML elements

HTML documents are defined by HTML elements. HTML element refers to all the code from start tag (opening tag) to end tag (closing tag), that is, start tag + content + END tag. HTML has start tag, which ends with end tag. For some elements to be empty (null), close in start tag.

Nested HTML elements

Most elements can be nested, and HTML text is composed of nested HTML elements.

e.g:

<body>-----Where the content of the <body> element is another HTML element.

<p>this is a paragraph</p>

</body>

P.s:1. Do not forget the end tag, most browsers will forget the end tag in the case of the correct display of HTML, but do not rely on this approach, forget to use end tag may produce unpredictable results or errors.

The 2.HTML tag is not sensitive to case, but it is best to use lowercase tags, because it is recommended to use lowercase in HTML4 and lowercase in future (X) HTML versions.

HTML properties

Provides additional messages for HTML elements.

The 1.HTML tag can have properties, and attributes provide more information about the element.

2. The attribute always appears as a name/value, E.g:name = "value", and is always specified in the start tag.

e.g:

1.<H1 align = center > heading

2.<body bgcolor = "Blue" > has additional messages about the background.

HTML Horizontal Line

P.S: Using

HTML annotations

Format is <!--......-->

e.g:<!--This is a comment-->

The browser ignores comments and does not display them.

HTML Split-line

If you want to wrap a line without creating a new paragraph, you should use <br/>

E.g:<p>this is a <br/>paragraph.</p>

P.S: The browser omits extra white space characters (spaces or carriage returns) from the source code when displaying HTML

Text formatting tags

<b> Bold characters

<em> Accent Font

<small> Reduce fonts <big> enlarge fonts

<i> Italic characters

<sub> define subscript words <sup> define Superscript

<pre> preserves spaces and wraps (usually without <pre>, HTML text automatically deletes extra spaces or returns)

<ins> Insert Word <del> Delete Word

References and terminology definitions

<ABBR title = "Etcetera" >etc</abbr> abbreviation

<acronym title = "World Wide Wed" >WWW</acronym> Capital letters

The contents of the title appear when the mouse points to the contents of these elements.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.