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

Error Handling:

Simple Toast Notification in Angular

Devta Part 1 by Mohiuddin Nawab

Two Sum

How to structure your TypeScript Node.js Application

Horizontal scroll animations in React Native

120 French Adverbs: An Easy Guide For You!

Why are promises better than callbacks?

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

Finishing Module 1 on HTML & CSS

All HTML5 Tags with their descriptions/Uses and examples

Essential chrome extensions for front-end developers

I am Abhishek Ganesh Takale.