Study notes: II

Keywords: html css

1, Self closing labels and notes

Comments in HTML. The contents of comments will be ignored by the browser and will not be displayed directly in the web page, but you can view comments in the source code. Comments are used to explain the code.

<!-- -->

During development, we must develop a good habit of writing notes, which are required to be simple and clear.

Comments can also hide something you don't want to display.

Comments cannot be nested

Tags generally appear in pairs, but there are also some self closing tags
For example:

<img>
<img />
<input>
<input />

2, Label properties

Property. You can also set properties in the label (start label or self-end label)
Property is a name value pair (x=y)
Property is used to set how the content in the label is displayed
Attributes and tag names or other attributes should be separated by spaces
Attributes cannot be written blindly, but should be written according to the provisions in the document,
Some attributes have attribute values and some do not. If there is an attribute value, the attribute value should be enclosed in quotation marks. (single quotation marks and double quotation marks are acceptable)
Example:

<h1>This is mine<font color="red" size='3'>Third</font>Webpage!</h1>

3, Document declaration

iteration
Web page version: HTML4, XHTML2.0, HTML5
Document declaration (doctype):
The document declaration is used to speed up the version of the browser's current web page
Document declaration for html5

<!doctype html>

Note: case is unlimited

4, Character encoding

You can set the character set of web pages through meta tags to avoid garbled code

<meta charset="utf-8">

5, Entity

Multiple spaces written in web pages will be automatically resolved into one space by the browser by default
Sometimes in html, we can't write some special symbols directly
For example, multiple consecutive spaces, such as the greater than and less than signs on both sides of the letter
If we need to write these special symbols in web pages, we need to use entities (escape characters) in html
Syntax of entity:
&Name of entity:
&nbsp; Space
&gt; Greater than sign
&lt; Less than sign
&copy; Copyright symbol

6, meta tag

<!-- meta It is mainly used to set some source data in web pages. Metadata is not for users
            charset Specifies the character set of the web page
            name    The name of the specified data
            content Contents of the specified data

                keywords Indicates the keywords of the website. Multiple keywords can be specified at the same time. Keywords can be used and separated
                    <meta name="keywords" content="">
                    <meta name="keywords" content="">

                description Specifies the description of the web site
                    <meta name="description" content="">
                    The description of the website will be displayed in the search results of the search engine

                title The contents of the tag are displayed as text on the hyperlink of the search structure
        -->
        <meta name="keywords" content="HTML5,front end, CSS3">
        <meta name="keywords" content="This is a very good website">
        <!--
            <meta http-equiv="refresh" content="3;url=https//www.mozilla.org">
            3 Seconds later, redirect the page to another web site
        -->

7, Semantic label (1)

<!--
        In web pages HTML Dedicated to the structure of web pages
            So in use html When labeling, we should focus on the semantics of the label, not its style

            Title label:
                h1~h6 There are six levels of titles
                from h1~h6 Diminishing importance, h1 Most importantly, h6 least important
                h1 The importance of web pages is second only to title Tag. Generally, there is only one tag in a page h1
                In general, the title label will only be used to h1~h3,h4~h6 Rarely used

                Title labels are block elements

            An element that monopolizes a row in a page is called a block element( block element)
    -->
    <h1>Primary title</h1>
    <h2>Secondary title</h2>
    <h3>Tertiary title</h3>
    <h4>Four level title</h4>
    <h5>Five level title</h5>
    <h6>Six level title</h6>

    <!--
        hgroup Tags are used to group headings. You can put a group of related headings into the group at the same time hgroup in
    -->
<hgroup>
    <h1>Two homecoming calligraphy</h1>
    <h2>firstly</h2>
</hgroup>

    <!--
        p A label represents a paragraph in a page

        p It is also a block element
    -->
    <p>stay p The content in the label represents a paragraph</p>
    <p>stay p The content in the label represents a paragraph</p>


    <!--
        em Labels are used to indicate the accentuation of voice intonation

        Elements that do not monopolize a row in a page are called inline elements(inline element)
    -->
    <p>What a nice day today!</p>
    
    <!--
        strong Emphasize, important content!
    -->
    <p>You have to do it today<strong>Finish your homework!</strong></p>

    Lu Xun said:
    <!-- q Represents a short reference -->
    <blockquote>
        I never said that!
    </blockquote>

    <!-- blockquote Represents a long reference -->
    confucius said:<q>Learn from time to time</q>

    <!--br Labels represent line breaks-->
    <br>

    It's a nice day today

Posted by TheUnknown on Tue, 21 Sep 2021 14:42:56 -0700