zoukankan      html  css  js  c++  java
  • HTML学习笔记——图片显示、图片跳转、图片相对路径

    1>显示图片、用a标签实现点击图片跳转、地图标签/点击图片上固定区域跳转

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    
    <body>
    
        <!-- 图片 -->
        <img src="dog.jpg" title="一只狗" alt"这是一只狗" usemap="#dogmap" />
        
        <!-- 用a标签实现点击图片跳转 -->
        <a href="http://www.baidu.com" target="_blank"><img src="dog.jpg" width="300" height="500" title="一只狗" alt"这是一只狗"/></a>
    
        <!-- 地图标签/点击图片上固定区域跳转 -->
        <map name="dogmap">
            <area shape="circle" coords="185,198,69" href="http://www.baidu.com" target="_blank" />
            <area shape="circle" coords="385,198,69" href="http://www.sina.com" target="_blank" />
            <area shape="rect" coords="50,50,100,100" href="http://www.sina.com" target="_blank" />
            <!-- 依次写各个点的坐标 -->
            <area shape="poly" coords="0,0,0,50,50,0" href="http://www.hao123.com" />
    
        </map>
    
    
    </body>
    </html>

    2>index图片相对路径

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    
    <body>
    
        <!-- ../代表往上反一层 -->
        <img src="../cat.jpg" />
    
        <!-- 相对路径 -->
        <img src="images/dog.jpg" />
    </body>
    </html>
  • 相关阅读:
    某个账号微信的微信朋友圈内容抓取 部分好友内容抓取
    密钥登录
    CPU处理器架构和工作原理浅析
    perl 安装Net::ZooKeeper
    perl 安装Net::ZooKeeper
    thinkphp 常用的查询
    thinkphp 常用的查询
    ThinkPHP 3.1.2 模板中的基本语法<2>
    ThinkPHP 3.1.2 模板中的基本语法<2>
    perl post 带上请求头
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/4663297.html
Copyright © 2011-2022 走看看