programminghead Logo

HTML Tutorial 5

Links in HTML

Links (HyperLinks) are found in nearly all Web-Pages. Links are used to Redirect user to one page to another. Other then Redirecting User Links can be used to Get and Send file, processing files in Background open a new tab ETC.
So in this Tutorial we are going to Learn about LINKS.

Link Tag <a>:

<a> or HTML Element Defines Links inside HTML Documents.
To add Links/Hyper links to a web-page we have to use HTML's <a> Tag for that. Between the starting <a> and closing </a> of Link we have to write our Text,

href Attribute :

HTML href attribute Defines the path/URL for our Link Tag.
for adding path to our Link Tag we have to write href attribute inside Link's Starting tag <a> and inside the Double quotas of href we have to gave our Web-Page's URL or Web-site's URLhref="url".
LIKE :


<a href="http://programminghead.com"> click here </a>

Local Links :

There is not always the case when you have to redirect your user to a page that's only available on the Internet, there are many cases when you just have to redirect or link a page from your Local Machine (Computer) or a file that available on the same Location/Folder/Directory.
in local web-page cases we can link a page without giving the full path. Just the file name and followed by the file Extension (.html)


  <a href="index.html"> Click me </a>

Empty/same Link

There are Some cases when you Don't want to Redirect user to Another page, or you just want to Link the Current page for some reasons like (Reloading the Same page), You can use Empty link.
You just have to enter # insider the href's double quotas href="#".


  <a href="#"> Click me </a>

This Empty url/# will redirect user to Current Web-page's location. You will find a # sign at the end of the url after clicking on the Empty URL.


<html>
 <head>
  <title>HTML Links</title>
 </head>
 <body>
  <a href="home.html"> Local Link </a> <br/>
  <a href="http://programminghead.com/test.html"> Link with full Path </a> <br/>
  <a href="#"> Empty/Current page Link </a> <br/>
  <a> un-click-able Link </a>
 </body>
</html>

Results :


HTML Links Style :

When you creates Links in HTML, you will get a Link output on its Default Blue Color, But using style you can change that.
just target your link by tag (a) or by id (#idname). and inside the Curly add css color Property and gave a Color to your Link Text.

Link Color Style Example :


a{
 color: red;
 }			

for Changing Link text's Background color, you have to use CSS background-color property.

Link Background Color Example :


a{
 background-color: yellow;
 }			

for Changing Link text's Font Size, you have to use CSS font-size property. This will resize your Link's text
for Changing Link's Font Family, you have to use CSS font-family property. This will change The Default Font of your Link's text
for adding Unrline to Link's text, you have to use CSS text-decoration property. This will change your Link's text default Font.


a{
 font-size: 15px;
 font-family: cursive;
 text-decoration: underline;
 }			

for adding a nice Hover Effect on Link's text. we have to use CSS :hover attribute right after the tag name/id. This will only runs the CSS Properties on Mouse Hover.

Link Hover Effect:


a:hover{
	background-color:red;
	color:white;
	text-decoration:underline;
       }			

results

Jump to/Bookmark using Links :

Using Links you can jump to any line in the web-page and external also. This will scroll your scrron to targeted text/div/image/para/headline etc.
so you just have to write your Targeted tag's ID after the # sign inside the href="" double quotes.

Targeted Line/para :


  <p id="five"> ParaGraph 5 </p>	
	

Targeted Line/para :


  <a href="#five"> Goto ParaGraph 5 </a>	
	

Bookmark/Goto Link Example :


<html>
<head>
	<title>Bookmark/Goto Link</title>
</head>
<body>
	<a href="#five">Goto Para 5</a><br/>
	<p>para 1</p>
	<p>para 2</p>
	<p>para 3</p>
	<p>para 4</p>
	<p id="five">para 5</p>
	<p>para 6</p>	
</body>
</html>

Results

goto Para 5

Para 1


Para 2


Para 3


Para 4


Para 5


Para 6

NOTE : You also can do the Same thing with External Webpages. You just have to write full path of external Webpage before the Hast sign #idname and ID name.


<a href="programminghead.com/test.html#five"> para file on External Web-page </a>	

HTML Link Target Attribute :

When we click on the HTML Links, the linked web-page loads on the same page. but there is Target Attribute who gives us freedom to Perform Different Tasks like . Link opens in new tab. small/Big pop-up etc.

_blank : Opens a new black tab in your Browser to load your Linked Web-Page.


<a href="test.html" target="_blank"> click me </a>	

_self : This is default HTML Link Target, It Opens a your Linked Web-Page in the same Browser Window.


<a href="test.html" target="_self"> click me </a>	

_parent : Opens parent links in a one Browser window inside Different Frames.


<a href="test.html" target="_parent"> click me </a>	

_top : Opens a your Linked Web-Page on the Entire Browser window.


<a href="test.html" target="_top"> click me </a>	

Link Example :


<html>
<head>
	<title>Bookmark/Goto Link</title>
	<style type="text/css">
		a:hover{
			background-color: red;
			text-decoration: underline;
			color: white;
		}
		#hideLink:hover{
			opacity: 0.5;
		}
	</style>
</head>
<body>
	<a href="test.html" target="_blank">new-tab Link</a><br/>
	<a href="test.html" target="_self">Default Link</a><br/>	
	<a href="test.html" target="_top">Top Link</a><br/>
	<a href="#">Empty Link</a><br/>
	<a id="hideLink" href="test.html">Low Opacity on Hover</a>	
</body>
</html>	

Result :

Comments

minecraft download mojang

http://tinyurl.com/y5df367o
05:25 am

Spot on with this write-up, I actually believe this amazing site needs far more attention. I'll probably be back again to read more, thanks for the info!

g

http://tinyurl.com/y4o5dtgm
02:05 pm

I've been surfing online more than three hours these days, yet I by no means discovered any fascinating article like yours. It's beautiful worth sufficient for me. Personally, if all web owners and bloggers made just right content material as you probably did, the internet will probably be a lot more useful than ever before.

download minecraft for free

http://tinyurl.com/y5jf539h
12:08 pm

I constantly spent my half an hour to read this webpage's articles every day along with a mug of coffee.

g

http://t.co/BCldSwC6nt
02:44 pm

I am actually grateful to the owner of this web page who has shared this great paragraph at here.

minecraft free

http://tinyurl.com/y4av3h62
06:06 am

Can I simply say what a comfort to uncover someone who genuinely knows what they are discussing online. You actually know how to bring an issue to light and make it important. More and more people ought to look at this and understand this side of your story. It's surprising you aren't more popular given that you certainly possess the gift.

g

http://t.co/HrbQRtcaU5
05:41 am

Good respond in return of this matter with solid arguments and describing all about that.

g

http://tinyurl.com/y5nwz54q
04:08 am

Thanks , I've recently been looking for information approximately this subject for ages and yours is the greatest I have found out till now. However, what about the conclusion? Are you positive in regards to the supply?

g

http://t.co/FCZSedT0MY
11:00 pm

I have read so many content regarding the blogger lovers but this post is truly a fastidious piece of writing, keep it up.

how to download minecraft free

http://tinyurl.com/y44kzobw
02:57 am

It's hard to find experienced people for this subject, but you sound like you know what you're talking about! Thanks

chepster.mytalk.io

http://chepster.mytalk.io/topic/12598
10:02 am

Kitap Siparis Almanya Yurdum Kitap

how to download minecraft free

http://t.co/2gFzrmsalb
08:46 am

Wonderful web site. Lots of helpful info here. I'm sending it to some pals ans also sharing in delicious. And naturally, thanks in your sweat!

Kĝb Bĝger

http://shasha.mytalk.io/topic/12225
12:58 am

Son Kitap Listesi Onl_ne Kitap

minecraft download mojang

http://tinyurl.com/y2at9xyu
10:23 pm

I am no longer sure where you're getting your info, however great topic. I needs to spend some time studying much more or understanding more. Thank you for great information I was looking for this information for my mission.

how to download minecraft

http://t.co/20pGasKp0a
07:02 am

Pretty element of content. I simply stumbled upon your blog and in accession capital to claim that I acquire actually enjoyed account your weblog posts. Any way I will be subscribing to your augment or even I achievement you access constantly quickly.

gamefly free trial

http://tinyurl.com/y34obvcs
09:44 am

I was recommended this website via my cousin. I'm no longer positive whether or not this post is written by way of him as nobody else recognize such distinct about my trouble. You are wonderful! Thank you!

gamefly free trial

http://tinyurl.com/yyjs9jra
05:57 am

Quality content is the secret to invite the viewers to pay a visit the site, that's what this web page is providing.

gamefly

http://t.co/KdjHA1ipGy
02:54 pm

Hello! I could have sworn I've been to this website before but after reading through some of the post I realized it's new to me. Nonetheless, I'm definitely delighted I found it and I'll be book-marking and checking back frequently!

gamefly

http://t.co/5zXaWf8JcY
12:33 am

Thanks for any other great post. Where else may just anybody get that type of information in such a perfect method of writing? I've a presentation subsequent week, and I'm on the search for such info.

gamefly

http://tinyurl.com/y5f9ntt3
08:16 pm

I loved as much as you'll receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this increase.

gamefly

http://j.mp/2GUzkgO
07:41 pm

Hi there! I'm at work browsing your blog from my new iphone 3gs! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the outstanding work!

gamefly

http://t.co/H9esu4YVfq
03:25 pm

I'd like to thank you for the efforts you have put in penning this site. I'm hoping to check out the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has encouraged me to get my own website now ; )

minecraft

http://tinyurl.com/yxam789p
05:31 am

I could not refrain from commenting. Perfectly written!

tinyurl.com

http://tinyurl.com/y5hygbxv
09:05 am

Valuable information. Fortunate me I discovered your website by chance, and I am surprised why this twist of fate didn't took place in advance! I bookmarked it.

minecraft

http://tinyurl.com/y45r4vnj
01:19 pm

Tremendous things here. I am very glad to see your post. Thanks a lot and I'm looking forward to contact you. Will you kindly drop me a e-mail?

Isabell

http://www.yahooo.com
08:45 pm

Yahoo's approach turned oout to be fully backwards.

doctorstrange.mytalk.io

http://doctorstrange.mytalk.io/topic/12089
01:07 pm

En Son C_kan K_taplar 2016 Kitap Listesi

http://infinitywar.mytalk.io/topic/11397

http://infinitywar.mytalk.io/topic/11397
02:12 am

Som Ç_kan Kitaplar Turkce Kitap Satin Al

pdf

http://doctorstrange.mytalk.io/topic/11848
11:27 am

10 Tl Lik Kitaplar Eski Kitaplar

Pdf Book Download

http://doctorstrange.mytalk.io/topic/11906
04:24 am

Popüler Kitaplar 2015 Nt Çok Satanlar

book

http://infinitywar.mytalk.io/topic/11380
08:13 pm

Uygun Kitap Fiyatlar_ Tüyap Kitap Fuar_ Kitaplar_

http://doctorstrange.mytalk.io

http://doctorstrange.mytalk.io/topic/11824
03:57 pm

Kitap Kurdu En Cok Satanlar En Çok Okunan Dini Romanlar

Ebook Pdf

http://zizavenger.mytalk.io/topic/11541
10:12 am

Ucuz Kitap Sipari_ Son Kitaplar Ç_kan

http://infinitywar.mytalk.io/topic/11272

http://infinitywar.mytalk.io/topic/11272
01:56 am

Ucuz Kitap Al Kap_da Ödeme Son Dönem Ç_kan Kitaplar

doctorstrange.mytalk.io

http://doctorstrange.mytalk.io/topic/11851
12:43 am

Öne Ç_kan Kitaplar Kitap Kurdu Sitesi

infinitywar.mytalk.io

http://infinitywar.mytalk.io/topic/11312
10:14 pm

Kitap Bulma Siteleri 2015 Y_l_nda En Çok Okunan Kitaplar

zizavenger.mytalk.io

http://zizavenger.mytalk.io/topic/11574
08:32 pm

Kargo Bedava Kitap Sitesi En Çok Al_nan Kitaplar

http://zizavenger.mytalk.io/topic/11532

http://zizavenger.mytalk.io/topic/11532
07:23 pm

En Son Kitaplar 2015 Kitap Sat__ Ma_azalar_

book

http://tonystark.mytalk.io/topic/10936
05:47 pm

Kampanyal_ Kitap Siteleri Kitap Sat_n

read

http://tonystark.mytalk.io/topic/11076
03:25 pm

Hepsiburada Kitap Sipari_i Yeni Ç_kan Roman Kitaplar_

tonystark.mytalk.io

http://tonystark.mytalk.io/topic/10971
01:57 pm

2016 Roman Kitaplar_ Kitap Nereden Al_n_r

http://tonystark.mytalk.io/

http://tonystark.mytalk.io/topic/10920
11:18 am

Ankara Ucuz Kitap Satan Yerler Türkçe Kitap Oku

minecraft

http://t.co/7jbFBn0BH2
10:52 am

Spot on with this write-up, I absolutely believe this website needs a great deal more attention. I'll probably be back again to read more, thanks for the information!

Ebook Pdf

http://tonystark.mytalk.io/topic/11064
10:00 am

Kitapyurdu Sipari_ Ver En Çok Okunan Romanlar 2016

read

http://tonystark.mytalk.io/topic/10977
02:06 am

En Son Ç_kan Kitaplar Listesi K_tap

tonystark.mytalk.io

http://tonystark.mytalk.io/topic/11069
07:28 pm

En Güzel Kitaplar Ve Fiyatlar_ Kitap Fuar_ndaki Kitaplar

http://jarvisforums.mytalk.io/

http://jarvisforums.mytalk.io/topic/10859
05:54 pm

Kitap Sat_n Al_nacak Siteler Ç_kan En Son Kitaplar

Danske Bĝger

http://jarvisforums.mytalk.io/topic/10739
04:06 pm

En Çok Okunan Yeni Kitaplar Kitapsepeti

http://jarvisforums.mytalk.io/topic/10755

http://jarvisforums.mytalk.io/topic/10755
06:05 pm

En Son Ç_kan Romanlar Kitap Yorum Siteleri

Ebook Pdf

http://newhulk.mytalk.io/topic/10294
04:35 pm

Tavsiye Edilen Kitaplar 2016 En Çok Satan Türk Kitaplar

http://newhulk.mytalk.io/topic/10133

http://newhulk.mytalk.io/topic/10133
01:25 am

En Çok Satanlar Kitap 2015 En Çok Okunan Roman Kitaplar_

newhulk.mytalk.io

http://newhulk.mytalk.io/topic/10443
03:45 pm

Kitap En Cok Satan En Iyi Kitap Alma Siteleri

minecraft

http://t.co/Pdx179lenE
10:47 pm

It's in point of fact a nice and helpful piece of information. I'm satisfied that you just shared this useful info with us. Please stay us up to date like this. Thanks for sharing.

read

http://newhulk.mytalk.io/topic/10476
07:54 pm

Son Zamanlar_n En Iyi Kitaplar_ 2016 Kitap Satan

read

http://newhulk.mytalk.io/topic/10189
03:54 pm

Son Dönem Kitaplar En Güzel Kitap Siteleri

minecraft

http://bit.ly/2EFkSqE
03:55 pm

Informative article, just what I wanted to find.

http://newhulk.mytalk.io/topic/10140

http://newhulk.mytalk.io/topic/10140
12:09 am

Kitap Almak Için Güvenilir Siteler Güvenilir Kitap Sat__ Siteleri

newbookz.epizy.com

http://newbookz.epizy.com/readfix1.html
03:01 pm

2016 Y_l_ Kitaplar_ En Uygun Kitap Al__veri_ Sitesi

reviews

https://bit.ly/2LLXuet
04:27 am

Hi there, its good piece of writing regarding media print, we all knoww media is a fantastic source of information.

canadian viagra without a doctor prescription

http://viagra.bingapproved.club
07:14 pm

Hey! Would you mmind if I share your blog with my twitter group? There's a lot of people that I think would really appreciate your content. Please let me know. Many thanks http://viagra.bingapproved.club

inhouse

http://tiny.cc/fwej3y
06:56 am

Does your site have a contact page? I'm haaving a tough time locating it but, I'd like to send you an email. I've got some suggestions for your blog yoou might be interested in hearing. Either way, great website and I look forward to seewing it improve over time.

download

http://spymethod.blogaaja.fi/son-populer-kitaplar-222/
02:21 pm

Online Kitap Indir Kitap Sat_n Almak Için En Iyi Site

defter

http://drumless.blogaaja.fi/yeni-kitab-516/
11:31 am

Idefix Kitap Gittigidiyor Kitap Al

drumless.blogaaja.fi

http://drumless.blogaaja.fi/en-cok-cikan-kitaplar-990/
06:11 pm

Kitap _ipari_ Verme Çok Okunan Kitaplar 2015

http://drumless.blogaaja.fi/en-son-kitaplar-2015-818

http://drumless.blogaaja.fi/en-son-kitaplar-2015-818/
02:49 pm

Haftan_n En Çok Okunan Kitaplar_ En Çok Okunan Roman Kitaplar_

Buch

http://bookchat.mypressonline.com/readuvry.html
12:12 pm

Kitap Fuar_ Indirimleri Nt De Sat_lan Kitaplar

lib

http://b2book.onlinewebshop.net/readqiin.html
12:48 pm

2015 En Cok Satan Kitaplar Son Güncel Kitaplar

libretto

http://gift14.blogaaja.fi/kitap-sepeti-668/
11:18 am

En Uygun Kitap Sat__ Sitesi Wwwkitap

pdf

http://bizzmike.blogaaja.fi/kitap-ucuz-479/
01:46 am

Internetten Kitap Sipari_i Nas_l Verilir Yeni Popüler Kitaplar

defter

http://openfi.blogaaja.fi/hit-kitaplar-2015-167/
03:40 pm

En Çok Satan Kitaplar En Iyi Türk Kitaplar_ 2016

https://rubyworth.home.blog/uxyncuadfxve822/

https://rubyworth.home.blog/uxyncuadfxve822/
02:39 pm

Öne Ç_kan Kitaplar Kargo Ile Kitap Sipari_i

http://gift14.blogaaja.fi/saat-ile-ilgili-kitaplar-301/

http://gift14.blogaaja.fi/saat-ile-ilgili-kitaplar-301/
11:33 pm

Online Ücretsiz Kitap Oku Son Yaz_lan Kitaplar

gift14.blogaaja.fi

http://gift14.blogaaja.fi/2016-kitap-isimleri-871/
04:37 am

Roman Kitap Isimleri En Büyük Kitap

Napoleon

http://www.metalsanalyzer.com
08:23 pm

Have you ever considered about adding a little bit more than just your articles? I mean, what you say is fundamental and all. But think of if you added some great pictures or video clips to give your posts more, "pop"! Your content is excellent but with images and videos, this blog could undeniably be one of the best in its field. Amazing blog!

Admin

Thanks. I will Work on That. Thank for your Kind Comment :)

Fred

http://www.diagnosticequipmentstore.com
08:04 pm

Heya! I'm at work surfing around your blog from my new apple iphone! Just wanted to say I love reading your blog and look forward to alll your posts! Carry on the great work!

Admin

Thanks. And Congratulations for your New I-Phone :)

Clay

http://www.te-equipment.com
08:04 pm

It's an awesome piece of writing in fafor of all the internet viewers; they will get benefit from it I am sure.

Admin

Thanks for this Kind Comment :)

Craig

www.ophthalmicinstrumentscenter.com
11:50 pm

I've been surfing on-line more than three hours lately, but I by no means found any attention-grabbing article like yours. It is pretty price enough for me. In my view, if all web owners and bloggers made good content as you probably did, the internet can be a lot more helpful than ever before.

Admin

Thanks. We are Glad to HELP you. Thanks for This Kind Comment.

Write to Us