Posted in css
12:00 am, November 4, 2025
 

Fix Jaggy Font Edges with CSS Font Smoothing and Antialiasing

If you've ever noticed that text on your website looks a bit jagged or pixelated - especially on certain browsers or high-resolution displays - this simple CSS snippet can help smooth things out.

Font rendering can vary significantly between browsers and operating systems. macOS tends to use subpixel antialiasing for crisp text at smaller sizes, while some webkit-based browsers (like Chrome on macOS) might default to a grayer, less sharp appearance. Adding font smoothing properties can force better antialiasing and legibility.

The following CSS applied globally (or to specific elements) often resolves these issues:

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

How It Works

  • -webkit-font-smoothing: antialiased; – Primarily affects WebKit browsers (Chrome, Safari) on macOS, switching from subpixel antialiasing to grayscale antialiasing, which can reduce jagged edges on thin fonts.
  • -moz-osx-font-smoothing: grayscale; – Enables grayscale antialiasing in Firefox on macOS for a similar effect.
  • text-rendering: optimizeLegibility; – A standard property that hints to the browser to prioritize readability, enabling better kerning and ligatures where supported.

Note: These properties are most noticeable on macOS. On Windows or Linux, the impact might be minimal since those systems handle font rendering differently. Also, some designers prefer the default rendering, so test thoroughly on your target devices.

This quick fix has been a go-to for many developers dealing with inconsistent text appearance across platforms. Give it a try if your fonts are looking a little rough around the edges!

Posted on kruxor.com – CSS tips and code snippets.

CSS

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

View Statistics
This Week
12
This Month
13
This Year
133

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Items in css
The CSS Unit You’re Not Using: VMAX Explained 📐 Stop Using Pixels! Use VW for Responsive CSS 🚀 CSS Backdrop-Filter Blur: Add a Stunning Blur to Any Background Overlay (Too Easy!) Fix Jaggy Font Edges with CSS Font Smoothing and Antialiasing CSS 4 box custom grid row - New Version - July 2025 override the hero image background on this page Striped Background Gradients in CSS + HTML Changing the Background in CSS Using accent-color to change check box color Making an image responsive using css using background cover flex to align pagination in list format make an image or element grayscale switch on mouse over rotate an element when its hover rotate an element when its selected Left Fixed nav with right fluid content css html vertical center css cursor types testing CSS Object Fit for Image fill rather than using background image on a div flip card animation 3d front and back css html six box grid css html custom no gap four box grid css html custom Kinda Crappy 3D button code 4 box custom grid css layout stack on mobile 1024 lower use an image in your list items ol ul li css grid container with 4 auto columns select something with custom data attribute css rainbow text background clip with linear gradient content-visibility and contain-intrinsic-size for page load rendering speed increase set a css grid to auto to make it stack on mobile truncate text with line clamp allow a certain number of lines using the :user-valid CSS pseudo-class add a button to an existing link using :after css bouncing loader animation in css center a box in the middle of the screen highlight a button with an animation css add an outline to everything! hide the first h3 tag on the page with css center align vertical 2 items in a container flex simple javascript no library accordion button zoom effect with expanding background scroll left animation using css counter-increment to add numbering to elements hidden scroll anchor for custom scroll position ken burns slow image zoom using a radial gradient for background overlay change selected color on input elements css animated duck on footer using filter grayscale to make an image dark bootstrap dark mode twitter icon font awesome
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


Bajo
Random CSS Property

ruby-position

The ruby-position CSS property defines the position of a ruby element relatives to its base element. It can be positioned over the element (over), under it (under), or between the characters on their right side (inter-character).
ruby-position css reference