Explore 100's Of Free Video Tutorials

Keep Learning, Keep Coding & Keep Sharing

CSS

CSS UI pseudoclasses - Part 2

Notes:

CSS - Pseudo Class Selectors (User Interface) - Part 2:

1.
selector : enabled
{
declaration list;
}
It selects any html element targeted by the selector, if its status is enabled (default)

Ex:
input : enabled
{
background-color : yellow;
}
It selects any input element, if its status is enabled

2.
selector : disabled
{
declaration list;
}
It selects any html element targeted by the selector, if its status is disabled

Ex:
input : disabled
{
background-color : black;
}
It selects any input element, if its status is disabled

3.
selector : checked
{
declaration list;
}
It selects any html element targeted by the selector, if its status is checked

Ex:
input : checked + span
{
color : white;
background-color : red;
}
It selects any span element, if it is a sibling of and immediately preceded by input element which is in checked state.

Interview Questions: