SlideShare une entreprise Scribd logo
1  sur  18
6
ADDING LINKS
OVERVIEW
• The a element
• External links with absolute URLs
• Links with relative pathnames
• Linking within a page (fragments)
• Targeting browser windows
• Mail links
Adding Links
<a> </a>
<a href="URL">Link text or image</a>
The href attribute provides the location (URL) of the resource.
You can link to any resource:
• HTML documents
• Images
• Movies
• PDFs
• More!
href Attributes
• Absolute URLs begin with the protocol (ex: http://).
• Relative URLs provide the path to a file on the same
server as the document containing the link
(ex: /directory/document.html).
• Long URLs can make the markup look complicated, but
the structure is the same:
External Links
• External links go to pages that are not on your server.
• An absolute URL is required, including “http://”
<li><a href="http://www.foodnetwork.com">The
Food Network</a></li>
Linking on Your Own Site
• When no protocol is provided, the browser looks on the
current server for the resource.
• A relative pathname describes how to get to the resource
starting from the current document.
• Pathnames follow UNIX syntax conventions.
Example Server Directory Structure
The following relative
pathname discussions
are based on this site
structure.
The root directory is
called jenskitchen.
How it looks in the
MacOS Finder
Linking in the Same Directory
When the linked
document is in the
same directory as
the current
document, just
provide its filename:
href="about.html"
Linking into a Lower Directory
If the linked file is in a directory, include the directory name
in the path.
href="recipes/salmon.html"
Linking into Two Directories
Include each subdirectory name in the path to the linked document:
href="recipes/pasta/couscous.html"
Linking to a Higher Directory
To back up a level, the ../ stands in for the name of the
higher directory:
href="../index.html"
Linking Up Two Directory Levels
Include a ../ for each level you need to back up to:
href="../../index.html"
Site Root Relative Paths
Starting the path with a slash / means the pathname starts at the
root directory. You don’t need to write the name of the directory.
href="/recipes/salmon.html”
NOTE: Site root relative
URLs are more flexible
because they work from
any document on the
site.
DOWNSIDE: They won’t
work on your own
computer because the /
will be relative to your
hard drive. You’ll need to
test it on the actual web
server.
Image src Pathnames
Relative pathnames are also commonly used to point to
image files with the src attribute:
<img src="/images/icons/next.svg" alt="next">
Linking Within a Page (Fragments)
Linking to a specific
point on a web page
is called linking to a
document fragment.
This is useful for
providing links down
to content from the
top of a long
document.
Linking to a Fragment
For example, to create a link from the letter H in a list at the top of
the page to the “H” heading farther down in the document:
Step 1: Identify the target destination.
Use the id attribute to give the target element a unique name:
<h2 id="startH">H</h2>
Step 2: Link to the target (#).
The # symbol before the name indicates that the link goes to a
fragment:
<p>… F | G | <a href="#startH">H</a> | I | … </p>
Targeting Browser Windows
The target attribute in the a tag tells the browser the name of
the window in which you want the linked document to open:
<a href="recipes.html" target="_blank">Recipe book</a>
target="_blank"
Always opens a new browser window.
target="name"
Opens a new window with that name and then opens all
subsequent targeted links with that name in the same window.
It may also open in an embedded frame (iframe) with that name.
Mail Links
Use the “mailto” protocol to make a linked email address
open in a mail program:
<a href="mailto:wonderwoman@example.com">Email
WonderWoman</a> (wonderwoman@example.com)
NOTE: Most browsers are configured to open the computer’s
primary email program, but this may not work for some users. Be
sure the email address is included on the page and use the
mailto link as progressive enhancement.

Contenu connexe

Tendances (20)

Seo audit fitpass.co.in via Nikola Minkov / Serpact
Seo audit fitpass.co.in via Nikola Minkov / SerpactSeo audit fitpass.co.in via Nikola Minkov / Serpact
Seo audit fitpass.co.in via Nikola Minkov / Serpact
 
Web architecture
Web architectureWeb architecture
Web architecture
 
ARTDM 171, Week 3: Web Basics + Group Projects
ARTDM 171, Week 3: Web Basics + Group ProjectsARTDM 171, Week 3: Web Basics + Group Projects
ARTDM 171, Week 3: Web Basics + Group Projects
 
6 html links
6 html links6 html links
6 html links
 
Introducing asp
Introducing aspIntroducing asp
Introducing asp
 
HTML Basics 2 workshop
HTML Basics 2 workshopHTML Basics 2 workshop
HTML Basics 2 workshop
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web development
 
Unit 2.1 Part 4
Unit 2.1 Part 4Unit 2.1 Part 4
Unit 2.1 Part 4
 
INLS461_day14a.ppt
INLS461_day14a.pptINLS461_day14a.ppt
INLS461_day14a.ppt
 
Session4
Session4Session4
Session4
 
Alfresco
AlfrescoAlfresco
Alfresco
 
Windows Vista
Windows VistaWindows Vista
Windows Vista
 
What is a disavow file?
What is a disavow file?What is a disavow file?
What is a disavow file?
 
How to Make HTML and CSS Files
How to Make HTML and CSS FilesHow to Make HTML and CSS Files
How to Make HTML and CSS Files
 
Using c panel with godaddy
Using c panel with godaddyUsing c panel with godaddy
Using c panel with godaddy
 
Dbms project file
Dbms project fileDbms project file
Dbms project file
 
Dipika arora ppts
Dipika arora pptsDipika arora ppts
Dipika arora ppts
 
Lesson 3: Linking It All Together
Lesson 3: Linking It All Together Lesson 3: Linking It All Together
Lesson 3: Linking It All Together
 
Url
UrlUrl
Url
 
Lecture2
Lecture2Lecture2
Lecture2
 

Similaire à Ch 6: Links

Similaire à Ch 6: Links (20)

HTML Lists & Llinks
HTML Lists & LlinksHTML Lists & Llinks
HTML Lists & Llinks
 
Links - IntraSystem and Absolute
Links - IntraSystem and AbsoluteLinks - IntraSystem and Absolute
Links - IntraSystem and Absolute
 
Html links
Html linksHtml links
Html links
 
Links in Html
Links in HtmlLinks in Html
Links in Html
 
LINKING IN HTML
LINKING IN HTMLLINKING IN HTML
LINKING IN HTML
 
HTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsHTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchors
 
Just Enough HTML for Fatwire
Just Enough HTML for FatwireJust Enough HTML for Fatwire
Just Enough HTML for Fatwire
 
Lecture1and2
Lecture1and2Lecture1and2
Lecture1and2
 
Html links
Html linksHtml links
Html links
 
Internet with HTML
Internet with HTMLInternet with HTML
Internet with HTML
 
Links - IntraPage
Links - IntraPageLinks - IntraPage
Links - IntraPage
 
List and Links.pptx
List and Links.pptxList and Links.pptx
List and Links.pptx
 
Web topic 7 html tags for links
Web topic 7  html tags for linksWeb topic 7  html tags for links
Web topic 7 html tags for links
 
How to make a website
How to make a websiteHow to make a website
How to make a website
 
HTML Linking Overview
HTML Linking OverviewHTML Linking Overview
HTML Linking Overview
 
Introduction to WEB HTML, CSS
Introduction to WEB HTML, CSSIntroduction to WEB HTML, CSS
Introduction to WEB HTML, CSS
 
Week 5 Lecture
Week 5 LectureWeek 5 Lecture
Week 5 Lecture
 
HTML Bootcamp
HTML BootcampHTML Bootcamp
HTML Bootcamp
 
Html links
Html linksHtml links
Html links
 
M02 un06 p01
M02 un06 p01M02 un06 p01
M02 un06 p01
 

Plus de Steve Guinan

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationSteve Guinan
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignSteve Guinan
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Steve Guinan
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box ModelSteve Guinan
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsSteve Guinan
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Steve Guinan
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSSSteve Guinan
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web ImagesSteve Guinan
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student InstructionsSteve Guinan
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up TextSteve Guinan
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big ConceptsSteve Guinan
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web WorksSteve Guinan
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting StartedSteve Guinan
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Steve Guinan
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Steve Guinan
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Steve Guinan
 
Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4 Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4 Steve Guinan
 

Plus de Steve Guinan (20)

Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
 
Chapter 17: Responsive Web Design
Chapter 17: Responsive Web DesignChapter 17: Responsive Web Design
Chapter 17: Responsive Web Design
 
Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning Chapter 15: Floating and Positioning
Chapter 15: Floating and Positioning
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
Chapter 8: Tables
Chapter 8: TablesChapter 8: Tables
Chapter 8: Tables
 
Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
Chapter 12: CSS Part 2
Chapter 12: CSS Part 2Chapter 12: CSS Part 2
Chapter 12: CSS Part 2
 
Chapter 11: Intro to CSS
Chapter 11: Intro to CSSChapter 11: Intro to CSS
Chapter 11: Intro to CSS
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
 
Chapter 7: Images
Chapter 7: ImagesChapter 7: Images
Chapter 7: Images
 
HubSpot Student Instructions
HubSpot Student InstructionsHubSpot Student Instructions
HubSpot Student Instructions
 
Ch 5: Marking up Text
Ch 5: Marking up TextCh 5: Marking up Text
Ch 5: Marking up Text
 
Ch 3: Big Concepts
Ch 3: Big ConceptsCh 3: Big Concepts
Ch 3: Big Concepts
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
 
Ch 1: Getting Started
Ch 1: Getting StartedCh 1: Getting Started
Ch 1: Getting Started
 
Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7Intro to Web Design 6e Chapter 7
Intro to Web Design 6e Chapter 7
 
Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6Intro to Web Design 6e Chapter 6
Intro to Web Design 6e Chapter 6
 
Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5Intro to Web Design 6e Chapter 5
Intro to Web Design 6e Chapter 5
 
Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4 Intro to Web Design 6e Chapter 4
Intro to Web Design 6e Chapter 4
 

Dernier

'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.CarlotaBedoya1
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 

Dernier (20)

'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 

Ch 6: Links

  • 2. OVERVIEW • The a element • External links with absolute URLs • Links with relative pathnames • Linking within a page (fragments) • Targeting browser windows • Mail links
  • 3. Adding Links <a> </a> <a href="URL">Link text or image</a> The href attribute provides the location (URL) of the resource. You can link to any resource: • HTML documents • Images • Movies • PDFs • More!
  • 4. href Attributes • Absolute URLs begin with the protocol (ex: http://). • Relative URLs provide the path to a file on the same server as the document containing the link (ex: /directory/document.html). • Long URLs can make the markup look complicated, but the structure is the same:
  • 5. External Links • External links go to pages that are not on your server. • An absolute URL is required, including “http://” <li><a href="http://www.foodnetwork.com">The Food Network</a></li>
  • 6. Linking on Your Own Site • When no protocol is provided, the browser looks on the current server for the resource. • A relative pathname describes how to get to the resource starting from the current document. • Pathnames follow UNIX syntax conventions.
  • 7. Example Server Directory Structure The following relative pathname discussions are based on this site structure. The root directory is called jenskitchen. How it looks in the MacOS Finder
  • 8. Linking in the Same Directory When the linked document is in the same directory as the current document, just provide its filename: href="about.html"
  • 9. Linking into a Lower Directory If the linked file is in a directory, include the directory name in the path. href="recipes/salmon.html"
  • 10. Linking into Two Directories Include each subdirectory name in the path to the linked document: href="recipes/pasta/couscous.html"
  • 11. Linking to a Higher Directory To back up a level, the ../ stands in for the name of the higher directory: href="../index.html"
  • 12. Linking Up Two Directory Levels Include a ../ for each level you need to back up to: href="../../index.html"
  • 13. Site Root Relative Paths Starting the path with a slash / means the pathname starts at the root directory. You don’t need to write the name of the directory. href="/recipes/salmon.html” NOTE: Site root relative URLs are more flexible because they work from any document on the site. DOWNSIDE: They won’t work on your own computer because the / will be relative to your hard drive. You’ll need to test it on the actual web server.
  • 14. Image src Pathnames Relative pathnames are also commonly used to point to image files with the src attribute: <img src="/images/icons/next.svg" alt="next">
  • 15. Linking Within a Page (Fragments) Linking to a specific point on a web page is called linking to a document fragment. This is useful for providing links down to content from the top of a long document.
  • 16. Linking to a Fragment For example, to create a link from the letter H in a list at the top of the page to the “H” heading farther down in the document: Step 1: Identify the target destination. Use the id attribute to give the target element a unique name: <h2 id="startH">H</h2> Step 2: Link to the target (#). The # symbol before the name indicates that the link goes to a fragment: <p>… F | G | <a href="#startH">H</a> | I | … </p>
  • 17. Targeting Browser Windows The target attribute in the a tag tells the browser the name of the window in which you want the linked document to open: <a href="recipes.html" target="_blank">Recipe book</a> target="_blank" Always opens a new browser window. target="name" Opens a new window with that name and then opens all subsequent targeted links with that name in the same window. It may also open in an embedded frame (iframe) with that name.
  • 18. Mail Links Use the “mailto” protocol to make a linked email address open in a mail program: <a href="mailto:wonderwoman@example.com">Email WonderWoman</a> (wonderwoman@example.com) NOTE: Most browsers are configured to open the computer’s primary email program, but this may not work for some users. Be sure the email address is included on the page and use the mailto link as progressive enhancement.