Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply font anti-alias effects in CSS? [duplicate]

How can we apply Photoshop-like font anti-aliasing such as crisp, sharp, strong, smooth in CSS?

Are these supported by all browsers?

like image 265
Mehar Avatar asked Jul 25 '13 17:07

Mehar


People also ask

What is anti-aliasing in CSS?

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.

What is anti alias font?

So, what is anti-aliasing? The simple description of anti-aliasing is that it makes fonts display with smooth curves and angles, not jagged, low res looking edges. So if “anti-aliased ” is smooth, the opposite, hard edged fonts would make sense to be called “aliased.” However, the better term is “bit-mapped.”

How do I make my font sharp in CSS?

Every browser with support for the text-rendering property. Assume every browser smooths fonts, setting text-rendering to geometricPrecision would disable the font smoothing to make the glyphs as precise as possible thereby disabling all font-smoothing and making corners, etc. sharper.

What is WebKit font smoothing CSS?

The font-smooth CSS property controls the application of anti-aliasing when fonts are rendered. This feature is non-standard and is not on a standards track. It depends on the browser used and the system specifications; thus, it may not work for every user.


2 Answers

here you go Sir :-)

1

.myElement{     -webkit-font-smoothing: antialiased;     -moz-osx-font-smoothing: grayscale;     text-rendering: optimizeLegibility; } 

2

.myElement{     text-shadow: rgba(0,0,0,.01) 0 0 1px; } 
like image 120
Gildas.Tambo Avatar answered Oct 22 '22 04:10

Gildas.Tambo


Works the best. If you want to use it sitewide, without having to add this syntax to every class or ID, add the following CSS to your css body:

body {      -webkit-font-smoothing: antialiased;     text-shadow: 1px 1px 1px rgba(0,0,0,0.004);     background: url('./images/background.png');     text-align: left;     margin: auto;  } 
like image 36
user3267537 Avatar answered Oct 22 '22 05:10

user3267537