活頁夾 標簽
00
| 參數 | 用法說明 |
| src | 圖片網址,必要項目。 |
| border | 圖片邊框,例如 border="0" 代表邊框為 0。 |
| alt | 圖片替代文字,當圖片顯示失效,則顯示 alt 文字。 |
| title | 圖片文字標示,當滑鼠移經圖片,自動顯示的文字。 |
| width | 圖片寬度,例如 width="120px" 代表寬度限制在 120px。 |
| height | 圖片高度,例如 height="100px" 代表高度限制在 100px。 |
| width:auto 自動判斷圖片寬度。 <img style="width:auto;" src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" /> | ![]() |
| width:300px : 將圖片寬度設為 300px。 <img style="width:300px;" src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" /> | ![]() |
| height: 100px; width: 100px; 將圖片 寬度 高度 設為 100px。 <img src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" style="height: 100px; width: 100px;" /> | ![]() |
| height: inherit; width: inherit; 將圖設為父層的寬度 高度屬性值。 <div style="height: 150px; width: 150px;"> <img src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" style="height: inherit; width: inherit;" /></div> | ![]() |
| max-width 及 max-height 設為 100px , 將圖 寬度/高度 有幾大都不能超出 100px。 <img src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" style="height: 400px; width: 400px;max-width:100px;max-height:100px;" /> | ![]() |
| height: 50% width: 50%; , 將圖 寬度/高度 設定跟父元素的 寬度是400px 的 50%,同樣父元素的 高度是400px 的 50% 那麼,這個 img 的 寬度/高度 應該是 200px。 原文網址:https://read01.com/jadPB.html。 <div style="height: 400px; width: 400px;"> <img src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" style="height: 50%; width: 50%;" /></div> | ![]() |
| box-shadow: 15px 15px 10px 0px rgba(20% , 20% , 40% , 0.6 ) : 設定圖片陰影。 <img style="box-shadow: 15px 15px 10px 0px rgba(20% , 20% , 40% , 0.6);" src="https://4.bp.blogspot.com/-aYcyfNZIe4Y/WUZAa7g5QsI/AAAAAAAAQBo/AkAUEIM3J-QvMfgzunpfBCbOnoBMcI5FwCLcBGAs/s600/images.jpg" width="200px" /> |
|
| #imgT 為這個 table id ,設定 id : < table id="imgT ......,加入下列 CCS 後出現背景圖案。 <style> #imgT {background-image: url("http://vignette1.wikia.nocookie.net/evchk/images/5/58/81421815156067047.jpg/revision/latest?cb=20140125161815"); -moz-background-size: contain; /*底圖就會依照區塊的大小,等比縮放到區塊中*/ -o-background-size: contain; /*底圖就會依照區塊的大小,等比縮放到區塊中*/ -webkit-background-size: contain; /*底圖就會依照區塊的大小,等比縮放到區塊中*/ background-position: center; /*置中*/ background-repeat: no-repeat; /*背景圖案不重複*/ border:2px solid #000000; /*邊框樣式與顏色*/ background-color:#CCCCCC; /*背景的顏色*/} </style> |
| <div id="div1">A</div> <div id="div2">B</div> | #div1:hover + #div2{ .css } 兩個獨立 div , hover 後面要加 + |
| <div id="div1">A <div id="div2">B </div> </div> | #div1:hover #div2{ .css } div1 內 div2 hover 後面無需加 + |
| <div id="div1">A</div> <div id="div2">B</div> | #div1:hover + #div2{ .css }
兩個獨立 div , hover 後面要加 +
|
| <div id="div1">A <div id="div2">B </div> </div> | #div1:hover #div2{ .css }
div1 內 div2 hover 後面無需加 +
|
<marquee direction="down" width="100%" height="200" behavior="alternate" >
<marquee behavior="alternate">
This text will bounce
</marquee>
</marquee>
| <marquee behavior=alternate>內容</marquee>左 右 移動 |
| <marquee vspace="30">上下空白30xp</marquee> |
| <marquee hspace="70">左、右空白70xp</marquee> |
| <marquee loop="0">執行無限次</marquee> |
| <marquee loop="3">執行3次 </marquee> |
| <marquee scrolldelay="100">間隔時間</marquee> |
| <marquee scrolldelay="500">間隔時間</marquee> |
| <marquee scrollamount="50">移動50xp</marquee> |
| <marquee scrollamount="1">移動1xp</marquee> |
| <marquee behavior="slide">內容</marquee> |
| <marquee direction="right">內容</marquee> |
| <marquee direction="up">內容</marquee> |
| <marquee direction="down">內容</marquee> |
| <marquee onmouseover="this.stop(); " onmouseout="this.start();">滑鼠到此</marquee> |
| <marquee scrollamount="40" style="width:40px" ><b>內容</b></marquee> |
| <marquee direction="down" width="100%" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> This text will bounce </marquee> </marquee> |
| <marquee style="vertical-align:middle;" scrollamount="5" width="40"><<<</marquee> ABCDE <marquee style="vertical-align:middle;" direction="right" scrollamount="5" width="40">>>></marquee> |