Classification of links css and js files and hyperlinks in HTML

1. Link the css files and JavaScript files in the site
Insert picture description here

<head>
    <meta charset="UTF-8">
    <title>link</title>
    <link rel="stylesheet" href="style/csdn.css">  <!--放在 head 标签内部-->
</head>

The js link file is recommended to be placed in the head tag, or at the end of the body tag

<head>
    <meta charset="UTF-8">
    <title>link</title>
    <link rel="stylesheet" href="style/csdn.css">  <!--放在 head 标签内部-->
    <script src="js/csdn.js"></script>  <!--可以放在这里-->
</head>

or

<body>
<div>
</div>
<script src="js/csdn.js"></script>  <!--还可以放在这里-->
</body>

2. Internal link
Insert picture description here
Put the linked target page and the linked page at the same level, not at the same level, you must add the full path of the target file

<div>
    <!--不会新打开一个页面-->
    <a href="link01.html">链接到页面link01</a>
    <!--会另外打开一个新页面-->
    <a href="link01.html" target="_blank">链接到页面link01</a>
</div>

href and target are two attributes of the a tag:
href is required and cannot be omitted and is used to specify the location of the link target;
target is the way the link page opens, _self is the default value, opened in the current window, and _blank refers to the Window opens

3. External links

    <!--链接外部网址  必须要写上 http:// -->
    <a href="http://www.baidu.com" target="_blank">链接到百度</a>

4. Empty connection: #When
no link target has been determined, use empty connection

<!--空连接 # -->
<a href="#">空连接</a>

5. Download link

<p>地址链接的是:文件 .exe 或者是 zip 等压缩包形式</p>
<a href="download.zip">文件下载</a>

6. Web page element links

<p>在网页中的各种网页元素,如文本、图像、表格、音视频等都可以添加超链接</p>
<a href="https://www.zcool.com.cn/"><img src="images/image01.jpg"></a>

7. Anchor link (same page)

<p>能够快速定位文章的内容  常用于点击目录标题跳转到目标内容</p>
<a href="#profile">个人简介</a>  <!--目录标题-->
<h3 id = "profile">个人简介</h3>  <!--目标内容-->

Note that the name in the hyperlink must be preceded by the # symbol; the name of the target content must be id = "".

Published 13 original articles · praised 2 · visits 327

Guess you like

Origin blog.csdn.net/weixin_46410264/article/details/104537945