Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

HTML Links:


HTML links are elements used to navigate between web pages or different sections within the same page. They are created using the <a> (anchor) tag. Here's the basic syntax:


Link Text

Here's an example:


Visit Example

This will create a link that says "Visit Example" and leads to the URL "https://www.example.com" when clicked.


HTML links can also be used to link to other parts of the same page by specifying the target location using the id attribute of the element to which you want to link.


For example:


Jump to Section 2

Section 2


in this example, clicking "Jump to Section 2" will scroll the page to the section with the id of "section2".


You can also use relative URLs to link to pages within the same website or directory structure. For example:


About Us

This will link to the "about.html" page in the same directory as the current page


Additionally, you can open the link in a new browser tab or window by adding the target="_blank" attribute:


Visit Example

This will open the "https://www.example.com" link in a new tab when clicked.




Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML

CSS

JavaScript

Python

SQL

Campus Learning

C

C#

java