Catherine_zhilin

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

 

一.在浏览器中插入图片:

 

(1)图片文件和当前文件在同一个路径下;

1 <!doctype html><html>
2 <head>
3     <!--<base href="/公共性文档/"></base>-->
4 </head>
5 <body>
6 <img  src="1..jpg">
7     </body>
8 </html>

 

(2)图片文件和当前文件不在同一个路径下:

1 <!doctype html><html>
2 <head>
3     <base href="/公共性文档/"></base>
4 </head>
5 <body>
6 <img  src="1..jpg">
7     </body>
8 </html>

 

二.

如果无法显示,浏览器将用文本代替图片:

1 <!doctype html><html>
2 <head>
3     <base href="/公共性文档/"></base>
4 </head>
5 <body>
6 <img  src="1..jpg" alt="DeluceRoom">
7     </body>
8 </html>

在旧版本的IE中测试结果:

三.限制图片的宽和高:(可能需要做等比例缩放处理)

1 <!doctype html><html>
2 <head>
3     <base href="/公共性文档/"></base>
4 </head>
5 <body>
6 <img  src="1..jpg" alt="DeluceRoom Hotel" width="304" height="228">
7     </body>
8 </html>

测试结果:

 

posted on 2018-04-12 09:25  kkkshiki  阅读(179)  评论(0编辑  收藏  举报