1.

what do you mean by shorthand notations in CSS3?

Answer»

A pseudo-class is a special keyword which is added to a selector which specifies the state of the element. There are around ~60 pseudo-classes available. Some of the relevant examples of pseudo-classes are ACTIVE, checked, disabled, empty, first-child, hover, focus, in-range, invalid, last-child, nth-child, optional, read-only, target, valid, VISITED, root, required which can actually be used to apply styles.

/* COLOR changes to Brown on Hovering on anchor tag */ a:hover{     color: brown; } /* Color changes to Red on clicking on anchor tag */ a:active{     color: black; } /* Color changes to red after visiting on anchor tag */ a:visited {     color: red; }

In the above example for anchor tag where: visited, hover and: active are used specify the state of the anchor tag and depending on the pseudo-classes the specific styles will be applied. By default, the color of the anchor tag will be BLUE, on hovering on the anchor tag the color will change to blue, on clicking on it when it activates the color will change to black and after clicking for the REMAINING period of time the color of the anchor tag will be in red.



Discussion

No Comment Found