You’re reading the English version of this content since no translation exists yet for this locale. Bu makaleyi çevirmemize yardım edin!
:active
CSS pseudo-class'ı kullanıcı tarafından o an kullanılan (buton gibi) elementleri temsil eder. Bu seçicinin etkinliği, fare ile gezinirken, sol tuşa bastığınızda aktifleşir ve bıraktığınızda son bulur. :active
seçicisi genellikle <a>
ve <button>
buton elementleri için kullanılmaktadır ancak diğer elementler için de tercih edilebilir.
/* Aktif edilmiş bir <a> elementinin seçicisidir. */ a:active { color: red; }
:active
pseudo-class'ı (:link
, :hover
, veya :visited
) değerleri tanımlı ise aktif olmayacaktır. Linkleri uygun bir şekilde stillendirebilmek için, :active
kuralını linklerle alakalı tüm kurallar arasında LVHA order olarak bilinen sırada, en sonda kullanın.
LVHA-order: :link
— :visited
— :hover
— :active
.
:active
pseudo-class must only apply to the primary button; on right-handed mice, this is typically the leftmost button.Syntax
:active
Example
HTML
<a href="#">This link will turn lime while you click on it.</a>
CSS
a:link { color: blue; } /* Unvisited links */
a:visited { color: purple; } /* Visited links */
a:hover { background: yellow; } /* User hovers */
a:active { color: lime; } /* Active links */
Result
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of ':active' in that specification. |
Living Standard | |
Selectors Level 4 The definition of ':active' in that specification. |
Working Draft | No change. |
Selectors Level 3 The definition of ':active' in that specification. |
Recommendation | No change. |
CSS Level 2 (Revision 1) The definition of ':active' in that specification. |
Recommendation | No change. |
CSS Level 1 The definition of ':active' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
:active | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 4 | Opera Full support 5 | Safari Full support 1 | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support 10.1 | Safari iOS Full support 1 | Samsung Internet Android Full support 1.0 |
Non-a element support | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 8 | Opera Full support 7 | Safari Full support 1 | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android ? | Safari iOS
Full support
1
| Samsung Internet Android Full support 1.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- See implementation notes.
- See implementation notes.