<a class="link" href="#">
我是一個連結
</a>
a.link {
color: cornsilk;
background-color: rgb(0,5,255);
}
Learn More →
width
, height
試試看會有什麼狀況:a.link {
width: 500px;
height: 400px;
color: cornsilk;
background-color: rgb(0,5,255);
}
而你會發現,什麼也沒變化。
這邊就牽涉到我們章節的主題:
打開網頁,右鍵選擇檢查: 點擊我們的 a
連結。
會發現,有一個地方叫做 display: inline
什麼是 inline ? inline 實際上就是根據該 elements
本身所帶出來的長寬來呈現樣式,並且不能夠做出使用者設定
// inline 無法自行設定長寬等屬性。
// blcok 可以有自己的寬高,並且會佔據一整行。
display: block;
a.link {
display: block;
width: 500px;
height: 400px;
color: cornsilk;
background-color: rgb(0,5,255);
}
Learn More →
2022 網頁開發全攻略教程 / CSS篇章 - other
使目標元素透明度改變 opacity 可設定範圍: 0 ~ 1.0 // 0 為完全透明。 <h1>標題測試</h1> h1 { display: inline-block; background: red; }
Dec 10, 2022border-collapse: 假設我有個表格長這樣: <table> <tr> <th>標題一</th> <th>標題二</th> <th>標題三</th> </tr>
Dec 10, 2022在 CSS 製作時,可以被編輯的項目樣式: 以此 HTML ul 做範例: <ul> <li>2008:團團圓圓到台灣</li> <li>2013:圓仔出生</li> <li>還沒有其他熊貓</li> </ul>
Dec 10, 2022什麼是 default value 指 HTML Tag 本身具備的 CSS 效果: <h1>,本身的文字大小就比較大,font-size 就非常明顯。 <div>,本身具備 - display:block;等。 透過 box-model 瀏覽並且觀察 Tag 本身的 default styling
Dec 10, 2022or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up