zoukankan      html  css  js  c++  java
  • a标签的使用

    a标签常见的功能有二个:1.定义一个连接   2.是锚点

    a.html:

    <head>
    <meta charset="UTF-8">
    <title></title>
    <!--在引入外部样式的时候 一定要指定rel=“stylesheet”-->
    <link href="" rel="stylesheet">
    </head>
    <body>
    <!--
    定义一个连接 或者是锚点

    所有的元素都有两个属性 id class
    -->
    <a name="top"></a>
    <a href="http://www.baidu.com" target="_self" title="百度一下">Baidu</a><br>
    <a href="http://www.baidu.com" target="_blank">Baidu</a>
    <a href="img.html" target="_blank">Baidu</a>
    <!--定义锚点-->
    <div style="height: 3000px"></div>
    <!--调用锚点-->
    <a href="#top">返回顶部</a>
    <!--href属性的值 如果不写或是# 则表示重新加载当前页面-->
    <a href="#">返回顶部</a>
    <a href="img.html#bottom">image-bottom</a>

    </body>
    </html>

    img.html:

    <!-- img 标签 作用 主要用于在页面中引入一张图片 或者是二进制类型的图片 -->
    <img src="images/1.jpg" alt="显示图片" title="这是一张图片" width="200px" height="479px"/>
    <div style="height: 3000px"></div>
    <a name="bottom"></a>

  • 相关阅读:
    敏捷之Scrum框架
    Google浏览器80版本以上无法打开系统页面问题
    ThreadLocal 了解
    简化两个list之间赋值操作
    linux下用命令调用dubbo服务
    13条代码审查建议
    初识MongoDB(1)
    linux日常常用命令整理
    java发起http请求
    工作思维方法
  • 原文地址:https://www.cnblogs.com/hwgok/p/5704530.html
Copyright © 2011-2022 走看看