Skip to content

24 ways to impress your friends

Vote down?

Victor Brito

@Martin de Lima: you do not need to use Compass for that purpose: just a nested rule in Sass, like this:

bc. .my-cool-link { &:hover, &:focus, &:active { background-color: MistyRose ; }

By the way, unless you have to be compliant with Internet Explorer 7 or below, the @:active@ pseudo-class is not necessary.

@Stomme Poes: When you cannot change the HTML structure, it can be a great idea to apply @role=“heading”@ and @aria-level=“1”@ to make a @div@ an @h1@-like element, or apply @role=“button”@ to make a @span@ a button. But, actually, changing semantics is sometimes at your own risk. If you want to change the semantics of an element or define its ARIA semantics explicitly, before doing it, you shall read Using ARIA in HTML, more especially its recommendations table: Steve Faulkner will thank you.