SlideShare ist ein Scribd-Unternehmen logo
1 von 8
LINKS
HTML5 & CSS Visual Quickstart Guide
Chapter 6
The Anatomy of a Link
• A link has 2 main parts
  • Destination
    • Specifies what will happen when visitor triggers/clicks the link
       • Go to another page
       • Jump within the page
       • Show an image
       • Download a file
  • Label
    • The part the visitor sees in browser or hears in screen reader
    • Can be text
       • Or image
       • Or both
    • Default: shown underlined and in blue
Creating a Link to Another Page
• <a href=“page.html”>Link</a>
   • page.html is the URL of the destination web page
   • Link is the label text, which will be highlighted (usually blue and
     underlined)
• <a href=“http://www.google.com”>Google</a>
Creating Anchors
• These identify specific sections of the same page
• Useful for creating a clickable Table of Contents
• <h2 id=“anchorname”>Text</a>
   • anchor name is the text you will use internally to identify that
     section of the Web page
   • Text is the words or images you wish to be referenced
• <h2 id=“descrip”>Description of the Main Characters</a>
Linking to a Specific Anchor
• Once you’ve created an anchor, you can link to it
• <a href=“#anchor name”>Link</a>
   • anchor name is the value of the name attribute in the destination’s
     a tag
   • Link is the highlighted text
   • The hash sign (#) is crucial here!
• <a href=“#descrip”>Description of the Main
  Characters</a>
• If anchor is in a separate document, use <a
  href=“page.html#anchorname”> to reference
  • No space between the URL and the #
  • This means you shouldn’t use spaces in your anchors!
Targeting Links to Specific Windows
• By default, link opens in same window
• Often useful to open link in a new window or tab
• Do this using target=“_blank”
• For example:
  • <a href=“http://www.google.com” target=“_blank”>Google</a>
Creating Other Kinds of Links
• Can also link to files, FTP sites, newsgroups, and even
  email addresses
• <a href=“http://www.site.com/path/file.ext”>File</a> would
  link to a non-HTML file
• <a href=“ftp://ftp.site.com/path”>FTP Site</a> would link
  to an FTP site
• <a href=“mailto:chokeonthis@sillyspambots.com”>Email address</a> would link

  to an email address
Creating Keyboard Shortcuts for Links
• Do this using attribute of a tag called accesskey
• <a href=“gatetseng.html#woody”
  accesskey=“w”>Woody</a> (Alt-W, Ctrl-W)
• Some gotchas:
  • Keyboard shortcuts don’t work in Opera
  • Unreliable in frames
  • Don’t override keyboard shortcuts built into the browser—such as
   Alt-F for accessing the File menu

Weitere ähnliche Inhalte

Was ist angesagt?

Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTMLAarti P
 
HTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsHTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsGrayzon Gonzales, LPT
 
HTML Link - Image - Comments
HTML  Link - Image - CommentsHTML  Link - Image - Comments
HTML Link - Image - CommentsHameda Hurmat
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)Ahsan Rahim
 
Wai yanleunglinktag
Wai yanleunglinktagWai yanleunglinktag
Wai yanleunglinktagwaiyanleung
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTMLMarlon Jamera
 
HTML5- Create divisions in a web page
HTML5- Create divisions in a web pageHTML5- Create divisions in a web page
HTML5- Create divisions in a web pageGrayzon Gonzales, LPT
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3Jeff Byrnes
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)ghayour abbas
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSSSyed Sami
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!Ana Cidre
 
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?Charlie Allen
 

Was ist angesagt? (20)

Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTML
 
Html links
Html linksHtml links
Html links
 
HTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsHTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchors
 
HTML Link - Image - Comments
HTML  Link - Image - CommentsHTML  Link - Image - Comments
HTML Link - Image - Comments
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Anchors!
Anchors!Anchors!
Anchors!
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)
 
Wai yanleunglinktag
Wai yanleunglinktagWai yanleunglinktag
Wai yanleunglinktag
 
Html links
Html linksHtml links
Html links
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
 
6 html links
6 html links6 html links
6 html links
 
HTML5- Create divisions in a web page
HTML5- Create divisions in a web pageHTML5- Create divisions in a web page
HTML5- Create divisions in a web page
 
HTML5 - My First Webpage
HTML5 - My First Webpage HTML5 - My First Webpage
HTML5 - My First Webpage
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
HTML Tags
HTML Tags HTML Tags
HTML Tags
 
Web Development 3 (HTML & CSS)
Web Development 3  (HTML & CSS)Web Development 3  (HTML & CSS)
Web Development 3 (HTML & CSS)
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
 

Andere mochten auch

Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis ppJoeVelarde
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4Jeff Byrnes
 
Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15Jeff Byrnes
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1Jeff Byrnes
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2Jeff Byrnes
 
Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7Jeff Byrnes
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5Jeff Byrnes
 

Andere mochten auch (7)

Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis pp
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4
 
Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2
 
Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5
 

Ähnlich wie Castro Chapter 6

Ähnlich wie Castro Chapter 6 (20)

Week 6 Lecture
Week 6 LectureWeek 6 Lecture
Week 6 Lecture
 
Hyperlink.85 to 86
Hyperlink.85 to 86Hyperlink.85 to 86
Hyperlink.85 to 86
 
html
htmlhtml
html
 
Web development basics
Web development basicsWeb development basics
Web development basics
 
Html
HtmlHtml
Html
 
Html for beginners part II
Html for beginners part IIHtml for beginners part II
Html for beginners part II
 
Understanding the Web Page Layout
Understanding the Web Page LayoutUnderstanding the Web Page Layout
Understanding the Web Page Layout
 
HTML Coding
HTML CodingHTML Coding
HTML Coding
 
Basic HTML/CSS
Basic HTML/CSSBasic HTML/CSS
Basic HTML/CSS
 
Xhtml and html5 basics
Xhtml and html5 basicsXhtml and html5 basics
Xhtml and html5 basics
 
HTML
HTMLHTML
HTML
 
LS2.1_V1_HTML.pptx
LS2.1_V1_HTML.pptxLS2.1_V1_HTML.pptx
LS2.1_V1_HTML.pptx
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
 
Week 5 Lecture
Week 5 LectureWeek 5 Lecture
Week 5 Lecture
 
02- Links, Structure and Layout with HTML.pdf
02- Links, Structure and Layout with HTML.pdf02- Links, Structure and Layout with HTML.pdf
02- Links, Structure and Layout with HTML.pdf
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
4_5926925443935505826.pptx
4_5926925443935505826.pptx4_5926925443935505826.pptx
4_5926925443935505826.pptx
 
Links - IntraSystem and Absolute
Links - IntraSystem and AbsoluteLinks - IntraSystem and Absolute
Links - IntraSystem and Absolute
 
Html intro
Html introHtml intro
Html intro
 
Sending link
Sending linkSending link
Sending link
 

Mehr von Jeff Byrnes

Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11Jeff Byrnes
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10Jeff Byrnes
 
Castro Chapter 9
Castro Chapter 9Castro Chapter 9
Castro Chapter 9Jeff Byrnes
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8Jeff Byrnes
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2Jeff Byrnes
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2Jeff Byrnes
 

Mehr von Jeff Byrnes (6)

Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10
 
Castro Chapter 9
Castro Chapter 9Castro Chapter 9
Castro Chapter 9
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2
 

Castro Chapter 6

  • 1. LINKS HTML5 & CSS Visual Quickstart Guide Chapter 6
  • 2. The Anatomy of a Link • A link has 2 main parts • Destination • Specifies what will happen when visitor triggers/clicks the link • Go to another page • Jump within the page • Show an image • Download a file • Label • The part the visitor sees in browser or hears in screen reader • Can be text • Or image • Or both • Default: shown underlined and in blue
  • 3. Creating a Link to Another Page • <a href=“page.html”>Link</a> • page.html is the URL of the destination web page • Link is the label text, which will be highlighted (usually blue and underlined) • <a href=“http://www.google.com”>Google</a>
  • 4. Creating Anchors • These identify specific sections of the same page • Useful for creating a clickable Table of Contents • <h2 id=“anchorname”>Text</a> • anchor name is the text you will use internally to identify that section of the Web page • Text is the words or images you wish to be referenced • <h2 id=“descrip”>Description of the Main Characters</a>
  • 5. Linking to a Specific Anchor • Once you’ve created an anchor, you can link to it • <a href=“#anchor name”>Link</a> • anchor name is the value of the name attribute in the destination’s a tag • Link is the highlighted text • The hash sign (#) is crucial here! • <a href=“#descrip”>Description of the Main Characters</a> • If anchor is in a separate document, use <a href=“page.html#anchorname”> to reference • No space between the URL and the # • This means you shouldn’t use spaces in your anchors!
  • 6. Targeting Links to Specific Windows • By default, link opens in same window • Often useful to open link in a new window or tab • Do this using target=“_blank” • For example: • <a href=“http://www.google.com” target=“_blank”>Google</a>
  • 7. Creating Other Kinds of Links • Can also link to files, FTP sites, newsgroups, and even email addresses • <a href=“http://www.site.com/path/file.ext”>File</a> would link to a non-HTML file • <a href=“ftp://ftp.site.com/path”>FTP Site</a> would link to an FTP site • <a href=“mailto:chokeonthis@sillyspambots.com”>Email address</a> would link to an email address
  • 8. Creating Keyboard Shortcuts for Links • Do this using attribute of a tag called accesskey • <a href=“gatetseng.html#woody” accesskey=“w”>Woody</a> (Alt-W, Ctrl-W) • Some gotchas: • Keyboard shortcuts don’t work in Opera • Unreliable in frames • Don’t override keyboard shortcuts built into the browser—such as Alt-F for accessing the File menu