5.1 HTML title Tags
The ① title (Heading) is defined by tags such as
② Make sure that the HTML heading tag is used only for headings. Don't use headings just to produce bold or large text.
The ③ search engine uses headings to index the structure and content of your Web pages.
④ because the user can quickly browse your Web page by title, it is important to use the title to render the document structure, H1 should be used as the main title (most important), followed by H2 (secondary importance), followed by H3, and so on. The ⑤ browser automatically adds blank lines to the front and back of the header.
⑥ by default, HTML automatically adds an extra empty line before and after a block-level element, such as a paragraph, a heading element, or both.
5.2 HTML Horizontal Line
①<HR/> Tags Create horizontal lines in HTML pages, self-closing labels.
The ②HR element can be used to delimit content. Using horizontal lines (
5.3 HTML Annotations
① can insert comments into HTML code, which improves readability and makes the code easier to understand. The browser ignores comments and does not display them.
Example:<!--This is a comment-
② reasonable use of annotations can help in future code editing efforts.
③ condition Comment
<!--[if IE 8]>
..... some HTML here ....
<! [endif]--> conditional annotations Define only HTML tags that are executed by Internet Explorer.
5.4 HTML paragraph <p>
The ① paragraph is defined by the <p> tag.
The ② browser automatically adds blank lines to and from the paragraph. (<p> is a block-level element)
③ using empty paragraph marks <p></p> to insert a blank line is a bad habit. Replace it with a <br/> tag!
④ don't forget to end the tag
5.5 HTML Folding Line <br/>
The <br/> element is an empty HTML element. Self-closing label.
5.6 HTML Group Tags <div> and <span>
① can combine HTML elements with <div> and <span>.
② most HTML elements are defined as block-level elements or inline elements.
Editor's note: "Block-level elements" are translated as block levels element, "inline elements" translated into the inline element.
③ block-level elements usually start (and end) with a new line when the browser is displayed.
Example:
④ inline elements typically do not start with new lines when they are displayed.
Example: <b>, <td>, <a>,
5.6.1 HTML <div> Elements
HTML <div> element is a block-level element that can be used to combine other HTML the container for the element.
The <div> element has no specific meaning. In addition, because it belongs to a block-level element, the browser displays the folded line before and after it. If used with CSS, the,<div> element can be used to set style properties on large chunks of content. Another common use of the <div> element is the document layout. It replaces the old-fashioned way of using tables to define layouts. Using the <table> element for document layout is not the correct use of the table.
5.6.2 HTML <span> Elements
HTML <span> elements are inline elements that can be used as containers for text.
The <span> element also has no specific meaning.
When used with CSS, the,<span> element can be used to set style properties for some text.
5.7 HTML class <class><div><span>
Classifying HTML (Setting the Class) allows us to define CSS styles for the class of the element.
Set the same style for the same class, or set different styles for different classes.
5.7.1 categorical block-level elements
HTML <div> elements are block-level elements. It can be used as a container for other HTML elements.
Set the class of the <div> element so that we can set the same class for the same <div> element
5.7.2 category in-line elements
HTML <span> elements are inline elements that can be used as a container for text.
Sets the class of the <span> element to be able to set the same style for the same <span> elements.
5.8 HTML Style <style>
The ①style property is used to change the style of an HTML element.
②html Style Property: Provides a common way to change the style of all HTML elements.
The ③ style is introduced in HTML 4, which is a new preferred way to change the style of HTML elements. HTML styles enable you to add styles directly to HTML elements by using the Style property, or indirectly in a separate style sheet (CSS file).
④ Deprecated tags and attributes
In HTML 4, there are a number of tags and attributes that are deprecated. Deprecated (Deprecated) means that these tags and attributes will not be supported in future versions of HTML and XHTML.
The message here is clear: Avoid using these deprecated tags and attributes!
Label |
Describe |
<center> |
Defines the centered content. |
<font> and <basefont> |
Defines the HTML font. |
<s> and <strike> |
Define strikethrough text |
<u> |
Define the underlined text |
Property |
Describe |
Align |
Define the alignment of text |
BgColor |
Define background color |
Color |
Define text color |
For these tags and attributes: Please use style instead!
HTML Learning Document-5, basic tag Introduction