现在的位置: 首页 > 综合 > 正文

Html之图片

2018年05月20日 ⁄ 综合 ⁄ 共 808字 ⁄ 字号 评论关闭

1:图片的备用说明(alt属性)

      alt属性用于链接图片不存在的情况,或者一些用户为了提高浏览器速度而关闭了图片下载,alt的作用很重要,它的内容会显示在浏览器中。

       <img src="images/dog_none.png" alt="这是一只狗的图片">

 

2:使用figure和figcaption元素为图片声明标题

      figure元素和figcaption元素结合来为图片、视频、表格或者嵌入元素声明标题,

    

<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312">
<title>Sample</title>
<style>
figure {
    display: block;
    margin: 0 auto;
    padding:20px;
    width:200px;
    text-align:center;
    border:1px #ccc dashed;
    clear:both;
}
figcaption {
    display: block;
    clear:both;
    text-align: center;
    font-style: italic;
}
figure img {
    padding: 10px;
    margin: 0 auto;
}
</style>
</head>

<body>
<figure> 
   <img src="images/icon_ch.png" alt="Chrome logo"> 
   <figcaption> 
      <p>这是Chrome流览器的标示</p> 
   </figcaption> 
</figure>




</body>
</html>

3:客户端图像映射和服务器端图像映射

     客户端图像映射:客户端图像映射没有那么复杂,鼠标移到图片时,指针对指示读者是否可以单击此区域,图像映射存储在图片的下一层,含有引用区域的相关信息

    服务器端映射:在图像上单击鼠标后,光标的相对位置坐标会被发送到服务器,然后服务器会通过一个专用程序来确定要执行的下一个步骤

【上篇】
【下篇】

抱歉!评论已关闭.