Skip to content

Commit db1558e

Browse files
committed
2 parents 689460d + e4d0956 commit db1558e

File tree

55 files changed

+5641
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5641
-187
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# These are supported funding model platforms
22

33
github: Ajay-Dhangar # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
4+
patreon: ajay_dhangar # Replace with a single Patreon username
55
open_collective: codeharborhub # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Related Issue
2+
[Cite any related issue(s) this pull request addresses. If none, simply state "None”]
3+
4+
## Description
5+
[Please include a brief description of the changes or features added]
6+
7+
## Type of PR
8+
9+
- [ ] Bug fix
10+
- [ ] Feature enhancement
11+
- [ ] Documentation update
12+
- [ ] Other (specify): _______________
13+
14+
## Screenshots / videos (if applicable)
15+
[Attach any relevant screenshots or videos demonstrating the changes]
16+
17+
## Checklist:
18+
- [ ] I have performed a self-review of my code
19+
- [ ] I have read and followed the Contribution Guidelines.
20+
- [ ] I have tested the changes thoroughly before submitting this pull request.
21+
- [ ] I have provided relevant issue numbers, screenshots, and videos after making the changes.
22+
- [ ] I have commented my code, particularly in hard-to-understand areas.
23+
<!-- [X] - put a cross/X inside [] to check the box -->
24+
25+
## Additional context:
26+
[Include any additional information or context that might be helpful for reviewers.]

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ This project is licensed under the [MIT License](LICENSE).
8888
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
8989
9090
![image](https://github.com/CodeHarborHub/codeharborhub/assets/99037494/a8645938-5269-4d97-93e7-206059266035)
91+
92+
93+
## Chat with us
94+
95+
[![Chat with us](https://github.com/CodeHarborHub/codeharborhub/assets/99037494/e898e0e8-7985-4adb-9730-a2588fcba78e)](https://www.patreon.com/ajay_dhangar/membership)
96+

courses/react-js/begginer-level/intro-to-react/lesson_3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ console.log('Hello, Node.js!');
125125

126126
Save the file and open a terminal or command prompt in the same directory. Run the following command to execute the JavaScript code using Node.js:
127127

128-
```bash title="Run hello.js with Node.js"
128+
```bash
129129
node hello.js
130130
```
131131

Lines changed: 185 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,191 @@
11
---
22
id: creating-hyperlinks
3-
title: Creating Hyperlinks in HTML
3+
title: Mastering the Art of Creating Hyperlinks in HTML
44
sidebar_label: Creating Hyperlinks
55
sidebar_position: 1
66
tags: [html, web-development, hyperlinks, links]
77
description: In this tutorial, you will learn how to create hyperlinks in HTML. Hyperlinks are used to link one web page to another, or to link to a specific section within the same web page.
8-
---
8+
---
9+
10+
# Mastering the Art of Creating Hyperlinks in HTML
11+
12+
Hello, web enthusiasts! Today, we're embarking on a journey through the magical world of hyperlinks in HTML. Whether you're a budding developer or a seasoned coder looking to brush up on the basics, understanding how to create and use hyperlinks effectively is essential. So, grab your favorite drink, get comfortable, and let's explore the wonders of `<a>` tags and the endless possibilities they bring to your web pages.
13+
14+
## What Are Hyperlinks Anyway?
15+
16+
Hyperlinks are the backbone of the web, allowing users to navigate between different web pages, documents, or even specific sections within a page. They are created using the `<a>` (anchor) tag in HTML and can link to various resources such as web pages, email addresses, files, and more.
17+
18+
### The Essential Tags
19+
20+
Before we dive into examples and practical applications, let’s get acquainted with the key HTML tags used to create hyperlinks:
21+
22+
1. `<a>`: This tag stands for "anchor" and is used to define the hyperlink.
23+
2. `href`: This attribute specifies the destination URL or resource for the hyperlink.
24+
25+
## The Basics
26+
27+
Let’s start with an example. Suppose you want to create a hyperlink to your favorite website. Here’s how you might do it:
28+
29+
```html
30+
<a href="https://www.example.com">Visit Example</a>
31+
```
32+
33+
In this example, the `<a>` tag creates a clickable link that directs the user to https://www.example.com when clicked. The text "Visit Example" is the clickable part of the link.
34+
35+
## Understanding the `href` Attribute
36+
37+
The `href` attribute is the heart of the hyperlink, defining where the link will take the user. It can point to various types of destinations, such as web pages, email addresses, phone numbers, and even specific sections within a page.
38+
39+
### Linking to External Websites
40+
41+
Here’s how you link to an external website:
42+
43+
```html
44+
<a href="https://www.google.com">Google</a>
45+
```
46+
47+
### Linking to an Email Address
48+
49+
To create a link that opens the user's email client:
50+
51+
```html
52+
<a href="mailto:example@example.com">Send an Email</a>
53+
```
54+
55+
### Linking to a Phone Number
56+
57+
To create a link that allows users to call a phone number:
58+
59+
```html
60+
<a href="tel:+1234567890">Call Us</a>
61+
```
62+
63+
### Linking to a Section Within the Same Page
64+
65+
To create a link that jumps to a specific section within the same page, you need to use the `id` attribute on the target element and link to it with a `#` symbol:
66+
67+
```html
68+
<a href="#section1">Go to Section 1</a>
69+
70+
<!-- Somewhere else on the page -->
71+
<h2 id="section1">Section 1</h2>
72+
```
73+
74+
Clicking "Go to Section 1" will scroll the page to the section with the `id` "section1".
75+
76+
### Opening Links in a New Tab
77+
78+
To open a link in a new tab, use the `target="_blank"` attribute:
79+
80+
```html
81+
<a href="https://www.example.com" target="_blank">Visit Example in a New Tab</a>
82+
```
83+
84+
When using `target="_blank"`, it's a good practice to add rel="noopener noreferrer" to enhance security and performance:
85+
86+
```html
87+
<a href="https://www.example.com" target="_blank" rel="noopener noreferrer">Visit Example in a New Tab</a>
88+
```
89+
## Styling Hyperlinks with CSS
90+
91+
To make your hyperlinks stand out or match the design of your website, you can style them using CSS. Here’s a basic example:
92+
93+
```css
94+
a {
95+
color: #007BFF;
96+
text-decoration: none;
97+
}
98+
99+
a:hover {
100+
color: #0056b3;
101+
text-decoration: underline;
102+
}
103+
```
104+
105+
```html
106+
<a href="https://www.example.com">Stylish Link</a>
107+
```
108+
109+
In this example, the hyperlink has a custom color and removes the default underline, but it underlines again on hover to indicate interactivity.
110+
111+
## Practical Applications
112+
113+
Now that we’ve covered the basics and some advanced techniques, let’s look at real-world applications of hyperlinks.
114+
115+
### Navigation Menus
116+
117+
Hyperlinks are essential for creating navigation menus. Here’s a simple example:
118+
119+
```html
120+
<nav>
121+
<ul>
122+
<li><a href="#home">Home</a></li>
123+
<li><a href="#about">About</a></li>
124+
<li><a href="#services">Services</a></li>
125+
<li><a href="#contact">Contact</a></li>
126+
</ul>
127+
</nav>
128+
```
129+
130+
### Link Collections
131+
132+
Use hyperlinks to create collections of resources, such as a list of favorite websites or helpful tools:
133+
134+
```html
135+
<ul>
136+
<li><a href="https://www.example1.com">Example 1</a></li>
137+
<li><a href="https://www.example2.com">Example 2</a></li>
138+
<li><a href="https://www.example3.com">Example 3</a></li>
139+
</ul>
140+
```
141+
142+
### Linking to Documents
143+
144+
Provide links to downloadable documents like PDFs:
145+
146+
```html
147+
<a href="/files/sample.pdf" download>Download Sample PDF</a>
148+
```
149+
150+
## Enhancing User Experience with Hyperlinks
151+
152+
Effective use of hyperlinks can significantly enhance the user experience. Here are a few tips:
153+
154+
### Descriptive Link Text
155+
156+
Always use descriptive text for hyperlinks. Avoid "click here" and instead use meaningful text that describes the link's destination:
157+
158+
```html
159+
<a href="https://www.example.com/features">Learn more about our features</a>
160+
```
161+
162+
### Accessible Links
163+
164+
Ensure your links are accessible by providing enough contrast and making them keyboard-navigable. Use the `title` attribute to give additional context if necessary:
165+
166+
```html
167+
<a href="https://www.example.com" title="Visit Example's homepage">Example</a>
168+
```
169+
170+
### Mobile-Friendly Links
171+
172+
Make sure your links are easy to tap on mobile devices by using larger touch targets:
173+
174+
```css
175+
a {
176+
padding: 10px;
177+
display: inline-block;
178+
}
179+
```
180+
181+
```html
182+
<a href="https://www.example.com">Tap-friendly Link</a>
183+
```
184+
185+
## In Conclusion
186+
187+
Creating hyperlinks in HTML is a fundamental skill that every web developer should master. Hyperlinks connect the vast web of information and make navigation intuitive and seamless for users. Whether you're linking to external websites, internal sections, or downloadable documents, the `<a>` tag is your go-to tool.
188+
189+
So go ahead, experiment with hyperlinks in your next project. Use them to create navigation menus, link collections, and more. Your users will appreciate the improved navigation and interactivity.
190+
191+
Happy coding!

0 commit comments

Comments
 (0)