Using an Inline Style to Format Hyperlinks

You can use styles to format text consistently throughout a web page.  Although styles follow a standard, not all browsers fully support styles.  (For example, Netscape and Internet Explorer vary in their support of styles.)  As a result, some features may or may not work depending upon which browser you use.  However, I find that the browser, Opera, seems to fully support styles.  You may want to download and install this free browser to verify that your styles are working properly.

Example

This is an example of a link that uses an inline style to remove the underline and format the link in a different color.  (You need to format the link in such a way that a visitor knows that it is a link.)  The code for an inline style is inserted within the HTML tag for the text you want to format.  Here's what the code looks like:

<p>This is an example of a <a href="http://www.pserie.psu.edu" style="text-decoration:none;color:red">link</a> that uses a style...<p>

Explanation...

  • To remove the underline, specify:  text-decoration equal to none.

  • To select a color, specify:  color equal to red (or use one of the 16 predefined colors; you can also specify the hex number of any color.)


Web site contact: ccwebmaster@psu.edu
Updated February 27, 2008
© 2005 The Pennsylvania State University