SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
! 
Copyright 2014 Lon Hosford. All Rights Reserved. www.lonhosford.com 
This is the voice transcript and screen captures from the video for this portion of the course. 
! 
!
In this exercise we learn how to add external hyperlinks to text content in a web page. 
!
We will create links to the Wikipedia website. One to their World Wide Web page, and one to their 
Hyperlink web page. 
!
We use the anchor tag. Its tag name is simply the letter a. 
!
It requires the href attribute to specify the URL of the external web page. 
!
By default the external web page replaces our page in the web browser's tab window. 
We can also open the external page in a new web browser tab window. 
!
We do this using the target attribute set to the underscore blank value. 
!
And we will test and explore how these choices work the web browser. 
!
To follow along, here is how to get set up. 
!
This is our snippets file and starting HTML practice file. 
The HTML is simple, but lets take a fast tour. 
!
There is one h1 element for the page heading. 
!
And there are several p elements. They have informative content about the anchor element. 
!
The styling is internal to the document. 
It just covers the basic CSS we need. 
!
To start we are going to make the text, World Wide Web, in the first paragraph a hyperlink. 
! 
!
We will link to the Wikipedia web page about the World Wide Web. 
!
Don't worry. We do not try to type other web site's URLs. We usually just copy them from the web browser 
address bar. 
!
Start with step 1 in the snippets file. 
Type before the text, the open angle bracket, the letter a for the anchor tag and a space. 
Then add the href attribute, the equals symbol and one double quote mark. 
!
Now we can copy and paste the URL from step 2. 
!
Then step 3 finishes the href attribute and the open "a" tag with a double quote and the close angle 
bracket. 
!
Next we need to add the close tag for the "a" element. 
That goes after the text we are using for the hyperlink. 
Follow step 4 and type the open angle bracket, the forward slash, the letter "a" and the close angle 
bracket. 
!
When you open your page in the web browser, you will see that the link text is underlined by default. 
!
If you have not visited the link before in the web browser that you are using, the default link text color is 
traditionally blue. 
!
When you hover the mouse over the link, the mouse pointer shows that the text can be clicked. 
!
Click the link and the Wikipedia web page will appear in the same tab window as your web page. 
!
When you examine the previous page button's drop down menu, you can see that your web page title 
element appears as the previous page. 
!
When you return to your web page, the link text shows the default color for a visited URL. Traditionally 
this is a purple color. 
!
This means that the URL for the hyperlink is in the web browser's history. 
One way to see that is to look at the drop down menu for the next page button. 
!
Next we are going to open the web page in a new tab window. 
Follow step 5 and after the ending double quote for the URL, add a space, then type the target attribute, 
and the equals symbol. 
The value is an underscore and the word blank inside of double quotes. 
!
Refresh the web page and click the hyperlink. 
!
Now you are not only taken to the Wikipedia page, but it will appear in a new tab window. 
This particular page also has links that can take the visitor onward to other pages. 
!
But your web page is still active in the original tab window. 
So the visitor can easily return to it regardless of what happens on the external web page's tab. 
You can leave both tabs open for now. 
!
Lets try one more for practice. 
This time we will make the word hyperlink a hyperlink. 
!
And we will link it to the Wikipedia page about hyperlinks. 
!
Type the code in step 6 before the word hyperlink. 
!
Next paste in the URL from step 7. 
!
Now step 8 finishes the href attribute with the double quote. 
Then add a space and the target attribute with the value of underscore blank enclosed by double quotes 
followed by the close angle bracket. 
!
Then the last step adds the close anchor element tag after the word hyperlink. 
You can save your work. 
!
Refresh the page. 
You will see the first hyperlink shows the visited color and our new hyperlink shows the unvisited color. 
These default styling behaviors can be changed using CSS. 
!
Click the new hyperlink and the Wikipedia page opens in a new tab. 
!
If you left the first Wikipedia page open, you see its tab is still available. 
!
Going back to your web page's tab, you see that the link text color is now showing that the page was 
visited, 
!
That does it for this exercise. 
You created the anchor element with link text. 
!
You learned to copy the external web page's URL and paste into your HTML code. 
That is a surefire way to avoid typos and headaches. 
!
The target attribute is useful for opening external web pages in other tab windows. This keeps your web 
page handy for your visitor's return. 
!
Our testing revealed the default styling. 
! 
!
This included underlined text along with the traditional color states of visited and unvisited hyperlinks. 
!
The visited state merely means that the URL is in the web browser's history. 
!
The web browser may clear its history based on the user expiration preferences. 
Or the user can choose to clear the web browser's history. 
!
Finally we saw the linked web pages opened in new web browser tab windows. 
!
Copyright 2014 Lon Hosford. All Rights Reserved. www.lonhosford.com 
This is the voice transcript and screen captures from the video for this portion of the course.

Más contenido relacionado

La actualidad más candente

HTML Link - Image - Comments
HTML  Link - Image - CommentsHTML  Link - Image - Comments
HTML Link - Image - CommentsHameda Hurmat
 
HTML_Day_Two(W3Schools)
HTML_Day_Two(W3Schools)HTML_Day_Two(W3Schools)
HTML_Day_Two(W3Schools)Rafi Haidari
 
Html_Day_One (W3Schools)
Html_Day_One (W3Schools)Html_Day_One (W3Schools)
Html_Day_One (W3Schools)Rafi Haidari
 
Html for beginners part II
Html for beginners part IIHtml for beginners part II
Html for beginners part IIUnaib Aslam
 
Presentation on HTML
Presentation on HTML Presentation on HTML
Presentation on HTML tauqeer199
 
Hour 3
Hour 3Hour 3
Hour 3dpd
 
Basic HTML Tutorial For Beginners
Basic HTML Tutorial For BeginnersBasic HTML Tutorial For Beginners
Basic HTML Tutorial For BeginnersDHTMLExtreme
 
Xhtml Part1
Xhtml Part1Xhtml Part1
Xhtml Part1nleesite
 
Web development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer CentreWeb development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer Centrejatin batra
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLMayaLisa
 
Xhtml Part2
Xhtml Part2Xhtml Part2
Xhtml Part2nleesite
 

La actualidad más candente (17)

Hyperlink
HyperlinkHyperlink
Hyperlink
 
LINKING IN HTML
LINKING IN HTMLLINKING IN HTML
LINKING IN HTML
 
HTML Link - Image - Comments
HTML  Link - Image - CommentsHTML  Link - Image - Comments
HTML Link - Image - Comments
 
6 html links
6 html links6 html links
6 html links
 
HTML_Day_Two(W3Schools)
HTML_Day_Two(W3Schools)HTML_Day_Two(W3Schools)
HTML_Day_Two(W3Schools)
 
Html_Day_One (W3Schools)
Html_Day_One (W3Schools)Html_Day_One (W3Schools)
Html_Day_One (W3Schools)
 
Html for beginners part II
Html for beginners part IIHtml for beginners part II
Html for beginners part II
 
Presentation on HTML
Presentation on HTML Presentation on HTML
Presentation on HTML
 
Hour 3
Hour 3Hour 3
Hour 3
 
Pres
PresPres
Pres
 
Basic HTML Tutorial For Beginners
Basic HTML Tutorial For BeginnersBasic HTML Tutorial For Beginners
Basic HTML Tutorial For Beginners
 
Xhtml Part1
Xhtml Part1Xhtml Part1
Xhtml Part1
 
Web development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer CentreWeb development Training in Ambala ! Batra Computer Centre
Web development Training in Ambala ! Batra Computer Centre
 
Intr To Html & Xhtml
Intr To Html & XhtmlIntr To Html & Xhtml
Intr To Html & Xhtml
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Xhtml Part2
Xhtml Part2Xhtml Part2
Xhtml Part2
 
Tags10x10
Tags10x10Tags10x10
Tags10x10
 

Destacado (7)

Reflexion
ReflexionReflexion
Reflexion
 
Html tags
Html tagsHtml tags
Html tags
 
The Basics of (X)HTML Tags
The Basics of (X)HTML TagsThe Basics of (X)HTML Tags
The Basics of (X)HTML Tags
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
 
Html and its tags
Html and its tagsHtml and its tags
Html and its tags
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
 
Tags in html
Tags in htmlTags in html
Tags in html
 

Similar a HTML a Element: Link to External Page

How To Create a Hyperlink in Microsoft Office PowerPoint
How To Create a Hyperlink in Microsoft Office PowerPointHow To Create a Hyperlink in Microsoft Office PowerPoint
How To Create a Hyperlink in Microsoft Office PowerPointMarc Morgenstern
 
Make hyperlink
Make hyperlinkMake hyperlink
Make hyperlinkalvin567
 
La build your own website september 5
La build your own website september 5La build your own website september 5
La build your own website september 5Thinkful
 
Html lessons kayz afridi-
Html lessons   kayz afridi-Html lessons   kayz afridi-
Html lessons kayz afridi-nilo30
 
Code inhtml5andcss3
Code inhtml5andcss3Code inhtml5andcss3
Code inhtml5andcss3Irfan Razzaq
 
Customizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSCustomizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSLaura Hartwig
 
Webdesign + Website thesis
Webdesign + Website thesisWebdesign + Website thesis
Webdesign + Website thesisHome
 
Overview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site DesignOverview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site DesignAmy Goodloe
 
SEO and the HTML title Element
SEO and the HTML title ElementSEO and the HTML title Element
SEO and the HTML title Elementlhosford
 
TID Chapter 8 Web Page Development
TID Chapter 8 Web Page DevelopmentTID Chapter 8 Web Page Development
TID Chapter 8 Web Page DevelopmentWanBK Leo
 
Web Design Notes
Web Design NotesWeb Design Notes
Web Design Notesbutest
 

Similar a HTML a Element: Link to External Page (20)

Adding Hyperlinks
Adding HyperlinksAdding Hyperlinks
Adding Hyperlinks
 
How To Create a Hyperlink in Microsoft Office PowerPoint
How To Create a Hyperlink in Microsoft Office PowerPointHow To Create a Hyperlink in Microsoft Office PowerPoint
How To Create a Hyperlink in Microsoft Office PowerPoint
 
Make hyperlink
Make hyperlinkMake hyperlink
Make hyperlink
 
La build your own website september 5
La build your own website september 5La build your own website september 5
La build your own website september 5
 
Html lessons kayz afridi-
Html lessons   kayz afridi-Html lessons   kayz afridi-
Html lessons kayz afridi-
 
BYOWHC823
BYOWHC823BYOWHC823
BYOWHC823
 
Html
HtmlHtml
Html
 
Fccwc326
Fccwc326Fccwc326
Fccwc326
 
Creating ebooks
Creating ebooksCreating ebooks
Creating ebooks
 
Tfbyoweb.4.9.17
Tfbyoweb.4.9.17Tfbyoweb.4.9.17
Tfbyoweb.4.9.17
 
Tfbyoweb.4.9.17
Tfbyoweb.4.9.17Tfbyoweb.4.9.17
Tfbyoweb.4.9.17
 
Code inhtml5andcss3
Code inhtml5andcss3Code inhtml5andcss3
Code inhtml5andcss3
 
Customizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSCustomizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSS
 
HTML Bootcamp
HTML BootcampHTML Bootcamp
HTML Bootcamp
 
Webdesign + Website thesis
Webdesign + Website thesisWebdesign + Website thesis
Webdesign + Website thesis
 
Week 6 Lecture
Week 6 LectureWeek 6 Lecture
Week 6 Lecture
 
Overview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site DesignOverview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site Design
 
SEO and the HTML title Element
SEO and the HTML title ElementSEO and the HTML title Element
SEO and the HTML title Element
 
TID Chapter 8 Web Page Development
TID Chapter 8 Web Page DevelopmentTID Chapter 8 Web Page Development
TID Chapter 8 Web Page Development
 
Web Design Notes
Web Design NotesWeb Design Notes
Web Design Notes
 

Último

Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolinonuriaiuzzolino1
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsMonica Sydney
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxgalaxypingy
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptxAsmae Rabhi
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 

Último (20)

Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 

HTML a Element: Link to External Page

  • 1. ! Copyright 2014 Lon Hosford. All Rights Reserved. www.lonhosford.com This is the voice transcript and screen captures from the video for this portion of the course. ! !
  • 2. In this exercise we learn how to add external hyperlinks to text content in a web page. !
  • 3. We will create links to the Wikipedia website. One to their World Wide Web page, and one to their Hyperlink web page. !
  • 4. We use the anchor tag. Its tag name is simply the letter a. !
  • 5. It requires the href attribute to specify the URL of the external web page. !
  • 6. By default the external web page replaces our page in the web browser's tab window. We can also open the external page in a new web browser tab window. !
  • 7. We do this using the target attribute set to the underscore blank value. !
  • 8. And we will test and explore how these choices work the web browser. !
  • 9. To follow along, here is how to get set up. !
  • 10. This is our snippets file and starting HTML practice file. The HTML is simple, but lets take a fast tour. !
  • 11. There is one h1 element for the page heading. !
  • 12. And there are several p elements. They have informative content about the anchor element. !
  • 13. The styling is internal to the document. It just covers the basic CSS we need. !
  • 14. To start we are going to make the text, World Wide Web, in the first paragraph a hyperlink. ! !
  • 15. We will link to the Wikipedia web page about the World Wide Web. !
  • 16. Don't worry. We do not try to type other web site's URLs. We usually just copy them from the web browser address bar. !
  • 17. Start with step 1 in the snippets file. Type before the text, the open angle bracket, the letter a for the anchor tag and a space. Then add the href attribute, the equals symbol and one double quote mark. !
  • 18. Now we can copy and paste the URL from step 2. !
  • 19. Then step 3 finishes the href attribute and the open "a" tag with a double quote and the close angle bracket. !
  • 20. Next we need to add the close tag for the "a" element. That goes after the text we are using for the hyperlink. Follow step 4 and type the open angle bracket, the forward slash, the letter "a" and the close angle bracket. !
  • 21. When you open your page in the web browser, you will see that the link text is underlined by default. !
  • 22. If you have not visited the link before in the web browser that you are using, the default link text color is traditionally blue. !
  • 23. When you hover the mouse over the link, the mouse pointer shows that the text can be clicked. !
  • 24. Click the link and the Wikipedia web page will appear in the same tab window as your web page. !
  • 25. When you examine the previous page button's drop down menu, you can see that your web page title element appears as the previous page. !
  • 26. When you return to your web page, the link text shows the default color for a visited URL. Traditionally this is a purple color. !
  • 27. This means that the URL for the hyperlink is in the web browser's history. One way to see that is to look at the drop down menu for the next page button. !
  • 28. Next we are going to open the web page in a new tab window. Follow step 5 and after the ending double quote for the URL, add a space, then type the target attribute, and the equals symbol. The value is an underscore and the word blank inside of double quotes. !
  • 29. Refresh the web page and click the hyperlink. !
  • 30. Now you are not only taken to the Wikipedia page, but it will appear in a new tab window. This particular page also has links that can take the visitor onward to other pages. !
  • 31. But your web page is still active in the original tab window. So the visitor can easily return to it regardless of what happens on the external web page's tab. You can leave both tabs open for now. !
  • 32. Lets try one more for practice. This time we will make the word hyperlink a hyperlink. !
  • 33. And we will link it to the Wikipedia page about hyperlinks. !
  • 34. Type the code in step 6 before the word hyperlink. !
  • 35. Next paste in the URL from step 7. !
  • 36. Now step 8 finishes the href attribute with the double quote. Then add a space and the target attribute with the value of underscore blank enclosed by double quotes followed by the close angle bracket. !
  • 37. Then the last step adds the close anchor element tag after the word hyperlink. You can save your work. !
  • 38. Refresh the page. You will see the first hyperlink shows the visited color and our new hyperlink shows the unvisited color. These default styling behaviors can be changed using CSS. !
  • 39. Click the new hyperlink and the Wikipedia page opens in a new tab. !
  • 40. If you left the first Wikipedia page open, you see its tab is still available. !
  • 41. Going back to your web page's tab, you see that the link text color is now showing that the page was visited, !
  • 42. That does it for this exercise. You created the anchor element with link text. !
  • 43. You learned to copy the external web page's URL and paste into your HTML code. That is a surefire way to avoid typos and headaches. !
  • 44. The target attribute is useful for opening external web pages in other tab windows. This keeps your web page handy for your visitor's return. !
  • 45. Our testing revealed the default styling. ! !
  • 46. This included underlined text along with the traditional color states of visited and unvisited hyperlinks. !
  • 47. The visited state merely means that the URL is in the web browser's history. !
  • 48. The web browser may clear its history based on the user expiration preferences. Or the user can choose to clear the web browser's history. !
  • 49. Finally we saw the linked web pages opened in new web browser tab windows. !
  • 50. Copyright 2014 Lon Hosford. All Rights Reserved. www.lonhosford.com This is the voice transcript and screen captures from the video for this portion of the course.