SlideShare a Scribd company logo
1 of 5
Download to read offline
Một vài Pseudo Class đơn giản
• Đây có thể nói là bài hướng dẫn chi tiết từng tính năng trong
CSS cuối cùng của serie Học CSS đơn giản này và các bài sau
chúng ta sẽ làm qua một số ví dụ thực tế. Trước khi bắt đầu với
một số ví dụ đó, mình muốn nói qua một xíu về Pseudo
Class – một tính năng trong CSS3 mà mình sẽ nói kỹ hơn ở
serie CSS nâng cao sau này. Bởi vì trong các tutorial sau,
chúng ta sẽ cần sử dụng một vài Pseudo class thông dụng.
•
Pseudo Class trong CSS là gì?
• Pseudo Class trong CSS được sử dụng để viết CSS cho một
trạng thái nào đó của một phần tử. Ví dụ viết CSS đổi màu các
liên kết khi rê chuột vào, đổi thuộc tính một phần tử khi nhấp
vào,….Các pseudo class được khai báo tại vùng chọn, đặt
đằng sau vùng chọn và có dấu hai chấm (:) ngăn cách. Ví dụ:
#link:hover (vùng chọn của #link khi rê chuột vào).
• Trong bài viết này, vì nó thuộc CSS căn bản nên mình chỉ nói
qua một số pseudo class đơn giản nhất mà cũng thường gặp
nhất khi viết CSS cho website
Một số Pseudo Class thông dụng
• :hover – Chọn trạng thái khi rê chuột vào một phần tử.
• :visited – Được sử dụng cho liên kết, chọn liên kết khi đã được
truy cập (dựa vào History trên trình duyệt).
• :link – Được sử dụng cho liên kết, chọn liên kết khi chưa nhấp
vào.
• :active – Chọn phần tử khi họ chọn/nhấp vào.
Một số ví dụ về pseudo class đơn giản
• Dưới đây là một số ví dụ cách sử dụng pseudo class trong
CSS3, trong đó mình có ngứa tay làm thêm phần chuyển động
với transition, nếu bạn chưa hiểu thì ở gần cuối serie mình có
giải thích.

More Related Content

Viewers also liked

Surface flingerservice(서피스 상태 변경 및 출력 요청)
Surface flingerservice(서피스 상태 변경 및 출력 요청)Surface flingerservice(서피스 상태 변경 및 출력 요청)
Surface flingerservice(서피스 상태 변경 및 출력 요청)fefe7270
 
How to import wordpress blog to your self hosted wordpress site
How to import wordpress blog to your self hosted wordpress siteHow to import wordpress blog to your self hosted wordpress site
How to import wordpress blog to your self hosted wordpress siteAbbie De Villar
 
Sandbox para ejercicios de programación
Sandbox para ejercicios de programaciónSandbox para ejercicios de programación
Sandbox para ejercicios de programaciónMario Garcia-Valdez
 
PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM
PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM
PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM MichalGromek
 
Logging configuration in mule
Logging configuration in muleLogging configuration in mule
Logging configuration in muleSon Nguyen
 
Introduction of Biochemistry
Introduction of BiochemistryIntroduction of Biochemistry
Introduction of BiochemistryAsheesh Pandey
 

Viewers also liked (8)

Surface flingerservice(서피스 상태 변경 및 출력 요청)
Surface flingerservice(서피스 상태 변경 및 출력 요청)Surface flingerservice(서피스 상태 변경 및 출력 요청)
Surface flingerservice(서피스 상태 변경 및 출력 요청)
 
How to import wordpress blog to your self hosted wordpress site
How to import wordpress blog to your self hosted wordpress siteHow to import wordpress blog to your self hosted wordpress site
How to import wordpress blog to your self hosted wordpress site
 
Sandbox para ejercicios de programación
Sandbox para ejercicios de programaciónSandbox para ejercicios de programación
Sandbox para ejercicios de programación
 
How To Use IFTT
How To Use IFTTHow To Use IFTT
How To Use IFTT
 
PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM
PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM
PLUG IN DIGITAL TOOLS TO YORU AUDITORIUM
 
Logging configuration in mule
Logging configuration in muleLogging configuration in mule
Logging configuration in mule
 
IFTTT for Business
IFTTT for BusinessIFTTT for Business
IFTTT for Business
 
Introduction of Biochemistry
Introduction of BiochemistryIntroduction of Biochemistry
Introduction of Biochemistry
 

More from Son Nguyen

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introductionSon Nguyen
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with muleSon Nguyen
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overviewSon Nguyen
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filterSon Nguyen
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in muleSon Nguyen
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with muleSon Nguyen
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in muleSon Nguyen
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in muleSon Nguyen
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weaveSon Nguyen
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler muleSon Nguyen
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-boundSon Nguyen
 
Batch job processing
Batch job processingBatch job processing
Batch job processingSon Nguyen
 
Using message enricher
Using message enricherUsing message enricher
Using message enricherSon Nguyen
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with muleSon Nguyen
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connectionSon Nguyen
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in muleSon Nguyen
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoftSon Nguyen
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectorsSon Nguyen
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introductionSon Nguyen
 

More from Son Nguyen (20)

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 
Jms queue
Jms queueJms queue
Jms queue
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 

Một vài pseudo class đơn giản

  • 1. Một vài Pseudo Class đơn giản
  • 2. • Đây có thể nói là bài hướng dẫn chi tiết từng tính năng trong CSS cuối cùng của serie Học CSS đơn giản này và các bài sau chúng ta sẽ làm qua một số ví dụ thực tế. Trước khi bắt đầu với một số ví dụ đó, mình muốn nói qua một xíu về Pseudo Class – một tính năng trong CSS3 mà mình sẽ nói kỹ hơn ở serie CSS nâng cao sau này. Bởi vì trong các tutorial sau, chúng ta sẽ cần sử dụng một vài Pseudo class thông dụng. •
  • 3. Pseudo Class trong CSS là gì? • Pseudo Class trong CSS được sử dụng để viết CSS cho một trạng thái nào đó của một phần tử. Ví dụ viết CSS đổi màu các liên kết khi rê chuột vào, đổi thuộc tính một phần tử khi nhấp vào,….Các pseudo class được khai báo tại vùng chọn, đặt đằng sau vùng chọn và có dấu hai chấm (:) ngăn cách. Ví dụ: #link:hover (vùng chọn của #link khi rê chuột vào). • Trong bài viết này, vì nó thuộc CSS căn bản nên mình chỉ nói qua một số pseudo class đơn giản nhất mà cũng thường gặp nhất khi viết CSS cho website
  • 4. Một số Pseudo Class thông dụng • :hover – Chọn trạng thái khi rê chuột vào một phần tử. • :visited – Được sử dụng cho liên kết, chọn liên kết khi đã được truy cập (dựa vào History trên trình duyệt). • :link – Được sử dụng cho liên kết, chọn liên kết khi chưa nhấp vào. • :active – Chọn phần tử khi họ chọn/nhấp vào.
  • 5. Một số ví dụ về pseudo class đơn giản • Dưới đây là một số ví dụ cách sử dụng pseudo class trong CSS3, trong đó mình có ngứa tay làm thêm phần chuyển động với transition, nếu bạn chưa hiểu thì ở gần cuối serie mình có giải thích.