![]() ![]()
|
Changing the color of a single linkControlling the color of links on a web page is easy using the LINK and VLINK attributes of the BODY tag, as follows: <BODY LINK="RED" VLINK="RED"> But what if you want several links to have different colors? The logical approach is to use the FONT tag, in this manner: <FONT COLOR="red"><A HREF="http://www.html-tips.com">Example Link</A></FONT> But here is what it produces: Example Link Example Link 2 Now here is the correct way to achieve the desired result: <A HREF="http://www.html-tips.com"><FONT COLOR="red">Example Link</FONT></A> Which produces: Example Link Example Link 2 Highlighting textWith this little trick, you can change the background color of text. If italics and bold don’t give you the emphasis that you want, try this, it makes text look highlighted. <SPAN STYLE="background:red">Highlighted Text</SPAN> You can replace "red" with your choice of color. The above produces: Highlighted Text Remove the underline from a single linkHere’s a way to remove the underline from a single link on your page. If you’re looking to remove the underline from all links on the page, see my tip in the design category. Ok, here it is: Add this attribute to your link Here’s an example and the code that produced it: Example Link <a href="http://www.html-tips.com" style="text-decoration: none"> Email link with subject filled inIf you get alot of email through your website, I know you’re wishing more people would put something in the subject field. Or, Let’s say you have more than one product or service on your site, you can place a link for more information by each product/service and know before you read them what is being requested. Here’s how: This is the normal mailto link: <A HREF="mailto:email@domain.com">Email Me</A> To add the subject, simply add, &Subject=Your choice of subject here, after your address. The whole thing looks like this: <A HREF="mailto:email@domain.com&Subject=Your choice of subject here">Email Me</A> and produces this: Email Me Open links in new windowThe biggest drawback to using affiliate programs on our pages is the simple fact that we send our users away from our site. We all know how difficult it is to get them there in the first place, so why do we send them away so easily? If you use the TARGET attribute with your links, when someone clicks a link on your page, it opens in a new window. Then when that window is closed, they’re back at your site. Place TARGET="_blank" into your links. An example is this: <A HREF="http://www.yourdomain.com" TARGET="_blank">Your Link</A> Example Link Text description mouseoverThis trick will display a description of your choice when the mouse hovers over a text link. It’s similar to the ALT tag for images. <A HREF="http://www.yourdomain.com" TITLE="Your Text Description">Example Link</A> Example Link Prevent browser cacheIf you update you pages frequently, this trick is a must to ensure that your users see the most recent content. When someone views a webpage, thier browser will cache, or make a copy of, your page for faster loading on the next visit. To prevent this, add the following meta tag: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> This, as with any meta tag, must be placed between the <HEAD> and </HEAD> tags. Escape from framesIf your site has a possibility of being shown within someone else’s frame, it’s a good idea to provide a link on your site that will remove the frame. You may even notice that users are staying longer on your site! Example Frame Breaker <A HREF="http://www.yoursite.com" TARGET="_top">Example Frame Breaker</A> Page redirectRedirecting users to a different page is most useful when you change the webpage’s address. If you think there’s a chance that someone will go to the old address, ie from a search engine or link trade, leave the old page up as long as possible with the following modification. <meta HTTP-EQUIV="REFRESH" content="0" url="http://www.yourdomain.com/index.html"> This, as with all meta tags, needs to be placed between the <HEAD> and </HEAD> tags. You can change the content="0" to any number of seconds that you want the browser to wait before redirecting. New Type of ListWhile learning HTML, you learned that there are 3 types of lists: the ordered list, which is numbered; Item 1 Item 2 Item 3 Item 4 One thing to note about this trick. Although it works fine with Internet Explorer and Netscape Navigator, it is not in accordance with the W3C spec, and may not work with other browsers.
|
|||||||||||||||||||||||||||||||||||||