Do you want to use the newest technology to style your web pages? Here's how!

Steps

  1. For example:
    <span style="(css)">Text</span>
    Almost any HTML tag can include "style," such as
    p
    or
    div
    What goes in between the quotes is the CSS part.
  2.   
    
    For example:
    <span style="font-family:times;">Text</span>
    will cause "Text" to use the Times font.
    Advertisement
  3. For example:
    <span style="font-family:times, georgia, serif;">Text</span>
    will cause "Text" to use the Times font. If times is not available, Georgia will be used. If neither Times nor Georgia are available, a generic serif font will be used.
  4.   
    
    For example:
    <span style="font:red;">Text</span>
    will cause "Text" to be red. You can use any valid HTML color name in the place of "red." You can also use a hex code. For example:
    <span style="font:#FFFFFF;">Text</span>
    will cause "Text" to be white.
    Advertisement


Expert Q&A

Ask a Question

      Advertisement

      Tips

      • Make sure all quotes, colons, and other symbols are in the correct places; otherwise, you may not receive an expected result.
      • You may want to test your code in multiple browsers, to make sure that it works in as many as possible.
      Advertisement

      About this article

      Thanks to all authors for creating a page that has been read 31,493 times.

      Is this article up to date?

      Advertisement