前端工程師學習手冊
  • 前端工程師學習手冊
  • 1. Web
    • 1.1 RESTful API
    • 1.2 HTTP status code
    • 1.3 Event bubbling
    • 1.4 在瀏覽器輸入網址並送出後,發生了什麼事?
    • 1.5 什麼是AJAX?
    • 1.6 CORS
    • 1.7 Cookie、LocalStorage、SessionStorage
    • 1.8 MVC VS Flux
  • 2. Javascript
    • 2.1 ES6
      • 2.1.1 var、let、const
      • 2.1.2 Arrow function
      • 2.1.3 Template Literals
      • 2.1.4 Object Literals
      • 2.1.5 Modules
      • 2.1.6 Promise
      • 2.1.7 Spread Operator & Rest Operator
    • 2.2 Array 操作方法
    • 2.3 closure
    • 2.4 hoisting
    • 2.5 Event loop
    • 2.6 Number
    • 2.7 This
  • 3. React
    • 3.1 React 介紹
    • 3.2 lifecycle
    • 3.3 Redux
    • 3.4 Redux-Saga
    • 3.5 Component 與 PureComponent
    • 3.6 Hook
  • 4. CSS
    • 4.1 inline、inline-block
    • 4.2 position
    • 4.3 selector priority
Powered by GitBook
On this page

Was this helpful?

  1. 4. CSS

4.3 selector priority

priority

selector

example

1

inline style in html tag

<div style="color:red">

2

tag#id

div#myID { color:red; }

3

#id

#myID { color:red; }

4

tag.class

div.myClass { color:red; }

5

.class

.myClass { color:red; }

6

tag

div { color:red; }

7

*

* { color:red; }

Previous4.2 position

Last updated 6 years ago

Was this helpful?