CSS基礎——css語法與選擇器優先級

css語法

<style>
	選擇符1{ 屬性: 值 ; 屬性: 值 ; ….. ;}
</style>

舉個例子,對所有a標籤進行css處理

<style>
	a {text-decoration: none}
	a:visited{color: #1e6b8b}
	a:hover{
            color: crimson;
            font-style: italic;
            font-size: 26px;
            text-decoration: none;
            cursor: help;
        }
</style>

選擇器的優先級

css的基本選擇器有
1.id選擇器——#id值{}
2.元素選擇器——標籤名稱{}
3.類選擇器——.類名{}
優先級別:
id > 類 > 元素

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章