Giter Club home page Giter Club logo

html-link-bootcamp-prep-000's Introduction

HTML Links

Overview

In this lesson we will do a quick review of HTML links.

What's Covered in This Lesson

  1. HTML standard and named anchor links
  2. Relative and absolute paths

Links

Links allow us to connect our pages and sites to each other. Arguably they give the world wide web its power by simply allowing one document to lead to the next.

<a href="http://example.com">This is a text link</a>

An anchor link <a> accepts an href (hypertext reference) attribute, which points to the location of the page or content we are linking to.

<a href="http://example.com">
  <img src="myimage.jpg" alt="Alternate text">
</a>

Anchor links can also wrap images as well as text. In fact anything we wrap a <a> around becomes a clickable linked item.

<a href="mailto:[email protected]">This is an email link</a>
<a href="tel:555-555-5555">This is a phone number link</a>

Special prefixes in the href can trigger specific actions.mailto: allows us to open an email editor; "tel:" tells cellular devices to dial a number.

<p id="tips">Useful Tips Section</p>
<a href="#tips">Jump to Useful Tips Section</a>

We can also create named anchor links that will scroll to content elsewhere in the same page. This is done by giving an id attribute to one element, and then setting the href of a link to #id where the ids match.

Relative and Absolute File Paths

Relative

about.html

Relative paths describe the location of resources within the same file system.

Absolute

http://example.com/about.html

Absolute paths describe the location of resources on the entire internet at large.

It is prefered that you use the relative path when linking to content within your own website. Then use absolute paths when linking to content on other remote websites.

Summary

  • HTML links can be defined as <a href="myfile.html">link text here</a>.

Resources

View Understanding Links in HTML on Learn.co and start learning to code for free.

html-link-bootcamp-prep-000's People

Contributors

annjohn avatar chrisbhansen avatar gj avatar jmburges avatar jongrover avatar pletcher avatar talum avatar yunglleung1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.