|
|
Changing the properties of links on a web pageThe color of link on a web page is set using the LINK attribute of the <BODY> tag. The default color is blue (#0000FF). That is, if you don't supply a color value (or color name) to the LINK attribute, the browser makes all the links on the web page blue in color. Specifying another value, say green, to the LINK attribute will turn all links in the document into green color. Two different colors for linksOnly one color can be set through the LINK attribute. With Style Sheets, you can have links of different colors and styles in the same document. Inline Styles<A HREF="someplace.html" STYLE="color:#FF00FF">Someplace</A> With inline styles, the style information is placed inside the <A> tag. The style consists of a property:value pair. In this case, the color property makes the link pink (hexadecimal code for pink is #FF00FF). SomeplaceIn addition to color, style sheets also allow you to set other values for the link such as font size, font face and text decorations. <A HREF="someplace.html" STYLE="color:#CC0000;text-decoration:none;font-size:14pt; font-face:Arial, Verdana, Sans-serif"> Someplace</A> There are four property:value pairs each is separated from the other by a semi-colon. font-size sets the size to 14 points, text-decoration removes the underlines from the link and font-family specifies the font to be used. SomeplaceEmbedded StylesInline styles are similar to the <FONT> tag. Populating a page with these is considered bad programming practice. It's better to include all the style information inside the document HEAD section. The Styles placed in the head are enclosed in the <STYLE>-</STYLE> tags.
<STYLE TYPE="TEXT/CSS">
A.implink {color:#FF9900;
font-size:12pt;
text-decoration:underline;
font-family:Verdana, Arial, Sans-serif}
</STYLE>
<A HREF="someplace.html" CLASS="implink">Someplace</A>
Page contents: Article on how to change the properties (such as color, font, style etc.) of hyperlinks on web pages using cascading style sheets (CSS).
Page URL: http://www.webdevelopersnotes.com/tips/html/ changing_the_properties_of_links_on_a_web_page.php3
|
|