Jump to content
xisto Community
Sign in to follow this  
electriic ink

A Complete Guide To Anchor Tags guide to anchor tags

Recommended Posts

Here are some things you can do with anchor tags:************* To link the another website: <a href="http://example.com/; name="Example" title="Example"> ************** To link to another webpage on your website: <a href="example.html"> Takes you to example.html in the same directory that you are in. <a href="/example/example.html"> The / after your first speech mark takes you to your first directory. It then says to take you example.html which is in directory example! *************** OK this looks a bit tricky but it's effective: <a href="example.html" onMouseOver="window.status='Mouse Over'; return true" onMouseOut="window.status='MouseOut';"> What it does is when you place your mouse over the link, the status bar - the bar which usually says Done when a page loads - displays Mouse Over and as it suggests when you place your mouse out, the status bar displays MouseOut. **************** Other cool things to do with anchor tags: <a onMouseOver="window.location='jk.html';"> Takes you to jk.html when you place your mouse over the link <a onMouseOver="window.alert('Lok')"> Displays an alert window when you place your mouse over the link. ***************** Other onMouse functions onMouseWheel - Some mice have wheels, when that is rolled the function takes place. onMouseClick - When the mouse is clicked on the link onMouseDown - When the mouse is pushed down not clicked EXAMPLE: <a onMouseWheel="window.alert('Luck')">Lucky</a> Displays an alert with Luck in it when the mouse wheel is rolled over link Lucky ************** Other pointers: Close off all anchor (a) tags with "</a>" Href stands for hyperlink reference. The onMouse functions will only work if the user has javascript. *************** Just trying to help :D / CMATCME

Share this post


Link to post
Share on other sites

The onmouseover attribute can be used in most HTML tags not just in anchor tags. If you're gonna use it with the anchor tag and not use the href attribute with it, like so<a onmouseover="alert('y halo thar');">Example</a>I suggest you just use a span tag.<span onmouseover="alert('y halo thar');">Example</span>That is the right way to do it otherwise the browser will think it's a link. Sure it will work either way but it's not proper HTML. Hey I'm just saying if you wanna do it the real right way do it like I said but if you don't care fine with me. Many major websites don't care anyway so it's never gonna change.

Share this post


Link to post
Share on other sites

Llinking within a document:

...<a href="#ch3">Go to chapter 3</a>texttexttext<a name="ch3">Chapter 3</a>texttext
When you click on the "Go to chapter 3" link you go to the anchor with the corresponding anchor.

Share this post


Link to post
Share on other sites

Are these tags relatively new? I dont remember seing that on the web design class i took a year ago. Will IE6 support them properly? Cause if they do im gonna use them!

Share this post


Link to post
Share on other sites

^ yes that's what I was saying, there shouldn't even be a guide to anchor tags, what is there to know? It's just a tag. If things were this hard there'd be a tutorial for every tag in this board. If you're making a tutorial do it on the whole XHTML scene or a major part of it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.