Two commonly used HTML tags

Image tag and path

  1. Directory folder: ordinary folders, stored inside page we do need the relevant material, such as html files, pictures, etc.

  2. Root: Open the first layer is the root directory folder

  3. path

    • relative path

      • Directory path to the location where the reference file as a reference base, and build out

      • In simple terms, the picture relative to the HTML page

        Relative path classification symbol Explanation
        With a path The image file is located in an HTML document with, such as <img src = "badidu.gif" />
        Under a Path / The image file is located in an HTML document, such as <img src = "imags / badidu.gif" />
        On a path ..、 The image file is located on an HTML document, such as <img src = "../ badidu.gif" />
    • Absolute path
      • It refers to the absolute position of the directory, directly to the target location, usually the path from the beginning of the letter

Hyperlink label

  1. In the HTML tags, <a> tag defines a hyperlink, the role is a page from another page links.
  2. Hyperlink syntax
<a href="跳转目标" target="目标窗口的弹出方式">文本或图像</a>
Attributes effect
href url address specifies the link target, (must attribute) when the application for the label attribute href attribute, he has a hyperlink function
target Used to specify the linked pages Open, which _self is the default value, ** _ blank ** open in a new window
  1. Hyperlinks classification
    • External links: for example, <a href=" http://www.baidu.com "target="_blank"> Baidu </a>
      • External links must start with http: // begin
    • Internal links: interconnection between internal pages of the site, a direct connection to the internal name of the page, such as <a href="index.html"> Home
    • Air connection: If you did not determine the link target, <a href="#"> Home </a>
    • Download Link: href if there is a file or archive, it will download the file. Address link is a file, .exe, or zip and other archive form
    • Links page elements: the various web page elements, such as text, images, tables, audio, video, and so can add a hyperlink
    • Anchor link: quickly navigate to a location on the page
      • In the text of the href attribute is connected, is provided in the form attribute value # name, such as the second current </a> <a href="#two">
      • Find the target position of the label, which just added an id attribute = name, such as <h3 id = "two"> in the second quarter introduction </ h3>

Note

Add some html document easier to read and understand but do not need to display the comment text on the page, you need to use comment tags

  1. Format: <- -!>

Special characters

In html page, some special symbols difficult or inconvenient to directly, in which case we can use the following characters to replace

Special characters description Character code
Whitespace &nbsp;
< Less than sign &lt;
> Greater than sign &gt;
& with &amp;
Renminbi &yem;
© copyright &copy;
® Trademark &reg;
Celsius & You;
± Positive and negative &plusmn;
* title &times;
/ ÷ &divide;
² square &sup2;
cube &sup3;

Guess you like

Origin www.cnblogs.com/SSPOFA/p/11753904.html