HTML
HTML Anchor tag
ΒΆHTML Anchor tag
The HTML Anchor tag <a>
is used to create a hyperlink to another web page or a specific location within the same web page. It is one of the most commonly used HTML elements on the web.
The basic syntax for the <a>
tag is:
<a href="url">Link Text</a>
The href attribute specifies the URL or location that the link should point to. The Link Text is the visible text that appears as a hyperlink on the web page.
For example, to create a hyperlink to the OpenAI website, the code would be:
<a href="https://devsenv.com/">Visit Devsenv</a>
Live Preview:
Visit Devsenv
To create a link to a specific location within the same web page, you can use the id attribute to specify the target location and then use the # symbol followed by the id value in the href attribute of the <a>
tag.
For example, to create a link to a section with an id of section-1, the code would be:
<a href="#section-1">Jump to Section 1</a>
Live Preview: Jump to Section 1
Then, in the HTML code for the section, you would include the id attribute like this:
<h2 id="section-1">Section 1</h2>
<p>This is the first section.</p>
When a user clicks on the hyperlink, the browser will automatically scroll to the location with the id of section-1.
All Tutorials in this playlist
Popular Tutorials
Categories
-
Artificial Intelligence (AI)
11
-
Bash Scripting
1
-
Bootstrap CSS
0
-
C Programming
14
-
C#
0
-
ChatGPT
1
-
Code Editor
2
-
Computer Engineering
3
-
CSS
28
-
Data Structure and Algorithm
18
-
Design Pattern in PHP
2
-
Design Patterns - Clean Code
1
-
E-Book
1
-
Git Commands
1
-
HTML
19
-
Interview Prepration
2
-
Java Programming
0
-
JavaScript
12
-
Laravel PHP Framework
37
-
Mysql
1
-
Node JS
1
-
Online Business
0
-
PHP
28
-
Programming
8
-
Python
12
-
React Js
19
-
React Native
1
-
Redux
2
-
Rust Programming
15
-
SEO - Search Engine Optimization
1
-
Tailwind CSS
1
-
Typescript
10
-
Uncategorized
0
-
Vue JS
1
-
Windows Operating system
1
-
Woocommerce
1
-
WordPress Development
2
Tags
- Artificial Intelligence (AI)
- Bash Scripting
- Business
- C
- C Programming
- C-sharp programming
- C++
- Code Editor
- Computer Engineering
- CSS
- Data Structure and Algorithm
- Database
- Design pattern
- Express JS
- git
- Git Commands
- github
- HTML
- Java
- JavaScript
- Laravel
- Mathematics
- MongoDB
- Mysql
- Node JS
- PHP
- Programming
- Python
- React Js
- Redux
- Rust Programming Language
- SEO
- TypeScript
- Vue JS
- Windows terminal
- Woocommerce
- WordPress
- WordPress Plugin Development