org.sonar.l10n.css.rules.css.S4649.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-javascript-plugin Show documentation
Show all versions of sonar-javascript-plugin Show documentation
Code Analyzer for JavaScript/TypeScript/CSS
If none of the font names defined in a font
or font-family
declaration are available on the browser of the user, the
browser will display the text using its default font. It’s recommended to always define a generic font family for each declaration of
font
or font-family
to get a less degraded situation than relying on the default browser font. All browsers should implement
a list of generic font matching these families: Serif
, Sans-serif
, cursive
, fantasy
,
Monospace
.
Noncompliant Code Example
a {
font-family: Helvetica, Arial, Verdana, Tahoma; /* Noncompliant; there is no generic font family in the list */
}
Compliant Solution
a {
font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
}
See
- CSS Specification - Generic font families