HTML TUTORIAL FOR BEGINNERS PART 3

You can use 'a’(anchor) element to link to content outside of your web page.
'a' elements need a web destination address called an href attribute. It also needs an anchor text to click on it.
For example:

<a href="https://www.unsplash.com">Unsplash</a>
The browser will display the anchor text which is 'Unsplash' when you click on it will takes you to 'https://www.unsplash.com’.
a (anchor) elements has some attributes like:
1. target
2. href
3. download

Target attribute takes some parameters like:
1. _blank
2. parent
3. itself
Examples:
<a href=’https://www.freecodecamp.org' target=’_blank’>Go to freecodecamp</a>
<a href=’https://www.freecodecamp.org' target=’parent’>Go to freecodecamp</a>

<a href=’https://www.freecodecamp.org' target=’itself’>Go to freecodecamp</a>
_blank parameter opens a new tab in web browser
parent parameter opens the link on its tab it means don’t open a new tab
itself is like parent parameter.
When you download a file via HTML it is super easy.

Look at below example:
<a href=’myfile.pdf' download>download my book</a>
download attribute takes an optional parameter, if you want to provide a new name for your after downloaded.
One important thing you can do via anchor element is that we can send email and call someone

Look at the example below:
<a href="mailto:ahmad@gmail.com">Email me</a>
<a href="tel:0090987654321">contact us</a>

--

--

--

I am a web developer who writes web development content for you to make web development easier

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The function map() in Javascript ES6

In-Browser ML with React.js and ML5.js 🤖

How to properly internationalize a React application using i18next

How to Create a Dynamic React App

5 Ways to Judge if an Object has a Property

BLOG POST 304

Pagekit | Made with Vue JS

I was invited to Adventures in Angular podcast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahmadullahnikzad

Ahmadullahnikzad

I am a web developer who writes web development content for you to make web development easier

More from Medium

Types of Boxes in CSS

Block Boxes and Inline Box

Move an element to the center using CSS Flexbox

Here, we have sample HTML which contains two classes namely outer and inner classes

How to install Sass on Linux — Ubuntu 18.04 / 20.04