How to Disable an Alias on a Font HTML

When the edges of a font appear pixilated and jagged, the font is "aliased." When the edges of a font are smooth and appear softened, the font is "anti-aliased." You can use Cascading Style Sheets to disable alias on a font in HTML. "Font-smooth" is an attribute in CSS3 that is meant to make fonts anti-aliased, but most browsers don't yet support it. To disable font aliasing, you must use the "text-shadow" attribute as a workaround.

Instructions

    • 1

      Add "<style>" tags to the page HTML, like so:

      <head>
      <style>
      </style>
      </head>

    • 2

      Insert "body { }" in between the "<style>" tags, so that the updated code resembles the following:

      <style>
      body { }
      </style>

    • 3

      Enter "color: ;" in between the curled braces, then enter the hexidecimal code for the preferred font color in between the colon and semi-colon. For example, to make all of the text black:

      body { color: #000000; }

    • 4

      Add "text-shadow: 0 0 1px rgba(#, #, #, 0.5);" to the "body" tag. Insert the new attribute after the "color" attribute. Your code should so far resemble the following:

      body { color: #000000; text-shadow: 0 0 1px rgba(#, #, #, 0.5); }

    • 5

      Replace each "#" with the the red, green and blue values for the text color. For example, if you want your text to be sea green, the hexadecimal code would be "#00FFAA", and the red, green and blue values would be 0, 255 and 170. Your code would look similar to the code below:

      body { color: #00FFAA; text-shadow: 0 0 1px rgba(0, 255, 170, 0.5); }

    • 6

      Save and upload the updated code to your website to disable alias on your fonts.

Tips & Warnings

  • The "body" element applies to all of the text in the body of the page. To change the font for text in another element, like a table cell or a div, you must add the CSS code for that element instead. For example:

  • td { color: ; text-shadow: ; }

Related Searches:

References

Resources

Comments

Related Ads

Featured