CSS - font-smooth
The font-smooth
CSS property controls the application of anti-aliasing when fonts are rendered.
Syntax
/* Keyword values */ font-smooth: auto; font-smooth: never; font-smooth: always; /* <length> */ font-smooth: 2em;
Webkit implements something similar with a different name: -webkit-font-smoothing
and different values, however, just like font-smooth, this is non-standard and should not be used.
none
- turn font smoothing off, show the text with jagged sharp edges.antialiased
- smooth the font on the level of the pixel, as opposed to the subpixel. Switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter.subpixel-antialiased
- on most non-retina displays this will give the sharpest text.
Firefox implements something similar with a different name: -moz-osx-font-smoothing
and different values, however, just like font-smooth, this is non-standard and should not be used.
auto
- Allow the browser to select an optimization for font smoothing, typicallygrayscale
.inherit
- Inherit from the parent element.unset
grayscale
- Render text with grayscale antialiasing, as opposed to the subpixel. Switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter.
Description
The font-smooth
CSS property controls the application of anti-aliasing when fonts are rendered.
- Initial value:
auto
- Applies to: all elements and generated content
- Inherited: Yes
- Percentages: relative to parent element's font size
- Media:
visual
- Computed value: as specified
Browser Compatibility
Feature | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 25.0 (see note) | 5.0 (see note) | Not supported | Not supported | 4.0 (see note) |
Feature | iOS Safari | Opera Mini | Opera Mobile | Android Browser |
---|---|---|---|---|
Basic support | ? (see note) | Not supported | Not supported | Not supported |
See Also
Specifications
Though present in early (2002) drafts of CSS3 Fonts, font-smooth
has been removed from this specification and is currently not on the standard track.
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/font-smooth