The tags used to produce links are the <a> and </a>.
The <a> tells where the link should start and the </a> indicates where the link ends.
Everything between these two will work as a link.
The target of the link is added to the <a> tag using
the href="http://www.whateverpage.com" setting.
The example below shows "Click here to go to LinktoHow".
You simply:
ADVANCED TEXT LINKSThe <a> tells where the link should start and the </a> indicates where the link ends.
Everything between these two will work as a link.
The target of the link is added to the <a> tag using
the href="http://www.whateverpage.com" setting.
The example below shows "Click here to go to LinktoHow".
|
You simply:
- Specify the target in the <a href=" ">.
- Then add the text that should work as a link.
- Finally add an </a> tag to indicate where the link ends.
Instead of just turning off the underline on all links you could be more specific in defining the way you want your links to work.
In the example below underlining is turned off for all links.
The A:hover tells the browser that when the mouse is over a link the underline should appear.
The hover option only works on MSIE 4+.
(But it does not cause an error on Netscape if you include it - the effect just does not appear.).
|
The methods described above will turn off the underline effect for links on the entire page.
If you want to turn off the effect for just a single link, add a style property to the<a href> tag:
|
NOTE:
The method described above only works on MSIE 3, Netscape 4 or newer browsers.
You can make multiple style settings instead of just removing the underline. Why not define the colors you want for visited links as well?
This example will show you how:
|
Try clicking the two links below to see how these effects would work. (links have been deactivated on this page)
|
You can create much more advanced links with CSS (Cascading Style Sheets).
IMAGE LINKS
If you want to make an image work as a link, the method is exactly the same as with texts.
You simply place the <a href> and the </a> tags on each side of the image.
Below is the HTML code used to make the image work as a link to a page calledmyfile.htm:
|
If you haven't entered a border setting you will see a small border around the image after turning it into a link. To turn off this border, simply add border="0" to the <img> tag:
|
Images that work as links can show a popup text when you place the mouse over it.
This is done with the alt property in the <img> tag.
For example:
|
If you want your link to open a page in a new window use the target="_blank" in the <a href> tag.
Targetting the link to "_blank" simply opens a new browser window that will load the linked page.
Linking to Yahoo the traditional way would require this link:
|
If you add a target="_blank", the page will open in a new window:
|
Click the link below to see this link in action:
If you want to customize the new window as to which buttons, menus etc. should be available and which size it should have, you will need to do that with javascript.
LINK TO EMAIL
Having a link that allows visitors to send email from your website can be a great addition to your site, making it easy for your visitors to send questions or comments.
There is a special link for this action.
Email links are done much the same as links to other pages, using the
<a href> tag.
An email link would require the following code:
|
This will result in the visitor's email program opening a new email with your address already in the To: field.
If you wish to have a specific subject in the email, you can add it to the html code using subject= setting :
|
Suppose you want an email link for your visitors containing specific text in the body of their message, simply add &body=:
|
Or combine all the options and allow your visitor to send email with the address, subject and text already entered.
|
useful post thanks. . . . . .
ReplyDelete