?

Log in

No account? Create an account
entries friends calendar profile SpaceParanoids.net Previous Previous Next Next
HTML Lesson of the Day - Jarrett Heather
Jarrett Heather's Journal
jarrett
jarrett
HTML Lesson of the Day
It's about time you learned how to write a hyperlink in HTML.

First of all, HTML tags are written inside <angled brackets>. Many tags are called containers, and they come in pairs. The first tag says when to start a type of markup, and the second tag says when to end. The end tag always starts with a forward slash ( / ). So, all container tags look like this:

<container>stuff in the container</container>

Okay, also, inside the first container you can define attributes to that tag. Most attributes are defined using the syntax attribute="value". If you were using the container <font>, you could define attributes like size="3", face="times new roman" or color="green". Every tag has its own set of attributes you can set.

The tag that creates a hyperlink is actually called an anchor. But the container itself is named <a>. The URL of the hyperlink (the page or site you are linking to) is defined in the attribute href, which stands for "hyper reference". So, a hyperlink tag almost always looks like this:

<a href="http://mysite.com">Visit my site</a>

Don't forget the http:// when writing a link. This is called an absolute reference. Without it, the browser will assume it's a relative reference, which means it will be looking for a document on the same site you are linking from. Chances are you'll be using absolute references most of the time, unless you are writing your own website.

But href is only one attribute for the <a> tag. There is also name, id, class, style, accesskey, tabindex, title and target, to name a few. The one other attribute I use most often is target, and it is handy for making a link automatically launch a new browser window. You can do this by setting target="_blank". Your hyperlink would then look like this:

<a href="http://mysite.com" target="_blank">Visit my site</a>

Feel free to practice making a link by posting a comment here.

Any questions?
19 comments or Leave a comment
Comments
From: chrysus Date: October 7th, 2003 11:04 am (UTC) (Link)

JHeazy...

Why are you giving Basic HTML lessons? Sick of poor looking journal entries in other people's journals?


Please, please do not ever give a lesson in frames. They need to be purged from the earth.
yellzer From: yellzer Date: October 7th, 2003 11:07 am (UTC) (Link)

Re: JHeazy...

Because his fiance is computer illiterate.
jarrett From: jarrett Date: October 7th, 2003 11:12 am (UTC) (Link)

Re: JHeazy...

I'm giving something back to the community... sharing the knowledge... feelin' the love.
From: chrysus Date: October 7th, 2003 11:35 am (UTC) (Link)

Re: JHeazy...

I see. How magnanimous. =)
From: qtkat Date: October 7th, 2003 01:22 pm (UTC) (Link)
why are you telling us this?
jarrett From: jarrett Date: October 7th, 2003 01:26 pm (UTC) (Link)
That's not a legitimate question. You get a C- for this post.

C-
yellzer From: yellzer Date: October 7th, 2003 01:28 pm (UTC) (Link)
Damn you're a rude bastard :)
jarrett From: jarrett Date: October 7th, 2003 01:31 pm (UTC) (Link)
D
See me after class
yellzer From: yellzer Date: October 7th, 2003 02:04 pm (UTC) (Link)

I'm so scared (with sarcasm)

Oh no...sounds like I'm getting a paddling from the teacher

:P~~~~~~
From: qtkat Date: October 7th, 2003 02:08 pm (UTC) (Link)
he's an @55.

:P
yellzer From: yellzer Date: October 7th, 2003 02:12 pm (UTC) (Link)
But a cute @55...that I fall more and more in love with everyday.

It's a sickness

:)
From: qtkat Date: October 7th, 2003 02:14 pm (UTC) (Link)
Yeah, he's ok. ;)
jarrett From: jarrett Date: October 7th, 2003 02:17 pm (UTC) (Link)
Still feelin' the love.
From: qtkat Date: October 7th, 2003 02:23 pm (UTC) (Link)

your head is big enough....

yeah, we love you. Now shut up with the fucking HTML lessons. ;p~~~
jarrett From: jarrett Date: October 7th, 2003 02:25 pm (UTC) (Link)

Re: your head is big enough....

Oh, okay! Next time you call me with an HTML question I'll remember that you already knew everything there is to know about HTML.
From: qtkat Date: October 7th, 2003 02:28 pm (UTC) (Link)

Re: your head is big enough....

oh um...er...hm. *nervous giggle*
yellzer From: yellzer Date: October 7th, 2003 02:51 pm (UTC) (Link)

Re: your head is big enough....

Play nice you guys
From: qtkat Date: October 7th, 2003 01:50 pm (UTC) (Link)

hmph.



:P~~~
(Deleted comment)
19 comments or Leave a comment