The basic syntax of HTML (link tags, introduction and use path)

First, the link label

  Syntax: <a href="目标地址"> shown on the label content </a>

  Role: can be implemented in the current page to jump to a new page operation

  Attributes

  1.target this property can be set to open a new page in the window which, when the value _blank, can be opened in a new window

  2.a tag has a href attribute by default, stored content is the address of the landing page

  3.href of property value is #, can be set to an empty link jump does not occur when the user clicks, the stations used, are generally used for the development phase, because many pages has not been completed, stations were empty link

<! DOCTYPE HTML > 
< HTML > 
    < head > 
        < Meta charset = "UTF-. 8" > 
        < title > Hyperlink tags and attribute values </ title > 
    </ head > 
    < body > 
        <-! Air link with # conduct stations, also known as jump page -> 
        < A href = "#" > Baidu, you know </ A > 
        < br /> 
        <-! has a link address -> 
        < A href = " http: // www.baidu.com " > Baidu, you know</ A > 
        <-! Disposed link in a new window punch -> 
        < br /> 
        < A the href = "http://www.baidu.com" target = "_ blank" > Baidu, </ A > 
    < / body > 
</ HTML >

 

 

Second, the path

  The so-called path we can be seen as a specific resource used to find the "go" off the road, in the program code as D: \ Thunder download \ HBuilderX.2.0.1.20190614 \ HBuilderX

  1, the absolute path: generally letter as a starting point to find it, or just an absolute URL addresses, it is not recommended to use absolute paths in the actual work

  2, the relative path: relative path to a file known as a starting point to find

Use three or relative path

  Path is a common existence, to find the picture as an example to explain the path to use in practice, the highest frequency of use relative paths that will be divided into three relative path: the path at the same level, the lower path, the higher path

  Note: The picture is an example of the meaning insert a picture other than an HTML file in the HTML file, while using a relative path, so the starting point is the relative path of the HTML file

    1. similar path: the same level refers to the HTML file and the target images in the same directory, using methods similar path, we just write the name of the picture on the line scr

      

    2. The lower path: lower level refers to the picture in the lower directory as the HTML file, in which case we need to use / find to penetrate (XX at XX)

      

    3. superiors path: the target picture in the parent directory of the HTML file, use this time to back off ../ Find

      

<! DOCTYPE HTML > 
< HTML > 
    < head > 
        < Meta charset = "UTF-. 8" > 
        < title > relative path </ title > 
    </ head > 
    < body > 
        <-! Parallel path -> 
         < IMG the src = "t014c45eaaa2508bc3e.webp.jpg" / > 
        <-! subordinate path -> 
        < IMG the src = "the src / t014c45eaaa2508bc3e.webp.jpg"  /> 
        <!- the upper path -> 
        < IMGsrc="../t014c45eaaa2508bc3e.webp.jpg" />
    </body>
</html>

 

 

 

 

 

 

 

 

 

    

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/jingdenghuakai/p/11032515.html