Browse DevX
Sign up for e-mail newsletters from DevX


HTML Basics: Links : Page 5

Learn to link to other pages. Make a link that lets other people email you. Change the color of your links.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Link Colors

<body link="colorvalue" vlink="colorvalue">

Browsers are set to use their own default colors for links—typically a blue for linked text and purple for linked text that the reader has visited. You aren't stuck with these colors—through attributes in the body tag you can change the color of both links and visited links.

Remember, a start body tag goes at the beginning of your page's content; an ending body tag goes at the end of your file. Everything between the start and end body tags appears in the Web browser.

Some people argue that you should never change the default colors for links and visited links. We don't agree. What is important, however, is that your link and visited link colors are consistent. People will learn pretty quickly that your links are limegreen—so keep them limegreen throughout the section or the site. Don't change them ramdomly on every single page.

Some people also say the links and visited links should never be the same color. We think you should do what makes sense to your site and your readers. For our site we use the same color for links and visited links; that's a style choice on our part. Your link color decisions should be part of your design process.

Setting Link Color

The link attribute sets the color for your linked text. You can specify color either by name or by a hexadecimal value. For example:

<body link="chocolate">

produces chocolate-colored links. Instead of appearing the the same color as the rest of the text or in the default blue, the links are a nice goldeny-brown.

Setting Visited Link Color

The vlink attribute sets the color for links which have already been visited. You can specify color either by name or by a hexadecimal value. For example:

<body link="chocolate" vlink=#ffffff>

produces chocolate-colored links. Visited links appear in a white, the color value represented by the hex value #ffffff.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date