Fork me on GitHub

图片对齐问题

  

 1 <html >
 2 
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 <style type="text/css">
 6 img.top {vertical-align:text-top}
 7 img.bottom {vertical-align:text-bottom}
 8 </style>
 9 </head>
10 
11 <body>
12 
13 <p>
14 这是一幅<img class="top" border="0" src="./1.jpg" width="80" heigh="60"/>位于段落中的图像。
15 </p> 
16 
17 <p>
18 这是一幅<img class="bottom" border="0" src="./1.jpg" width="80" height="40" />位于段落中的图像。
19 </p>
20 
21 <!-- 相反的状态 -->
22 <p>
23 这是一幅<img class="bottom" border="0" src="./1.jpg" width="80" height="40" />位于段落中的图像。
24 </p>
25 <p>
26 这是一幅<img class="top" border="0" src="./1.jpg" width="80" heigh="60"/>位于段落中的图像。
27 </p> 
28 
29 </body>
30 
31 </html>

第一第二这种排版是相对来说比较好的

posted @ 2015-06-06 17:10  ZZZZW  阅读(361)  评论(0编辑  收藏  举报
AmazingCounters.com