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>
  • 相关阅读:
    修改默认runlevel
    shell数学运算
    Ubuntu碎碎念
    编译Linux-2.6.23内核中遇见的错误
    CentOS设置静态IP
    多线程--对象锁和类锁
    [Unity移动端]Touch类
    [Lua]string与中文
    MQTT 5.0 新特性(四)Clean Start 与 Session Expiry Interval
    EMQ 9 月 新发 | EMQ X Enterprise 3.4.0 功能概览
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/4663297.html
Copyright © 2011-2022 走看看