標籤:html_ 圖片 建立 middle 預設 座標 tom 大小 中間
插入圖片的基本格式為:<img src="url" />
可插入的屬性有---替換文本:alt="替換文字"
對齊:align="bottom"(與底部對齊,預設是此方式)、"middle"(中間)、"top"(頂部)
浮動方式:align ="left"(浮動在文本左邊)、"right"
圖片大小:width="50" height="50"(通過width、height屬性可以對圖片進行縮放)
將圖片用作連結:
<a href="//lastpage.html">
<img border="0" src="/eg_buttonnext.gif" /> //border是外邊框大小屬性
</a>
<map> 標籤
<img src="planets.jpg" border="0" usemap="#planetmap" alt="Planets" /><map name="planetmap" id="planetmap">
<area shape="circle" coords="180,139,14" href ="venus.html" alt="Venus" /> <area shape="circle" coords="129,161,10" href ="mercur.html" alt="Mercury" /> <area shape="rect" coords="0,0,110,260" href ="sun.html" alt="Sun" /></map>
usemap 屬性與 <map> 元素的 name 或 id 屬性相關聯,以建立 <img> 與 <map> 之間的關係。# + 要使用的 <map> 元素的 name 或 id 屬性。
shape後是圖片的形狀(circle圓;rect矩形)coords指位置,大小:圓(橫座標,縱座標,半徑)矩形(左上方橫座標,左上方縱座標,右下角橫座標,右下角縱座標)
若是背景圖片,則格式為:<body background="/i/eg_background.jpg">
HTML_圖片、地圖