Learn how to create hyperlinks to three different websites using the <a> tag with proper attributes and styling.
To create an HTML webpage that demonstrates how to create hyperlinks to three different websites using the <a> (anchor) tag with proper attributes and styling.
In this practical, you will create links to three different websites. The websites can be:
target="_blank" for external links so they open in a new tab, keeping your page open for the user. Use descriptive link text so users know what to expect.
| Method | Description | Best For |
|---|---|---|
| Button-Style | Links styled as clickable buttons | Call-to-action, navigation |
| List-Style | Links organized in a list format | Resource lists, directories |
| Graphical Cards | Links with icons and descriptions | Feature grids, homepages |
| Simple Text | Plain text links with href |
Inline links, paragraphs |
| Attribute | Purpose | Example |
|---|---|---|
href |
Destination URL (required) | href="https://google.com" |
target |
Where to open the link | target="_blank" |
title |
Tooltip text on hover | title="Visit Google" |
rel |
Relationship to the linked page | rel="noopener" |
| Mistake | Why It's Wrong | Correct Way |
|---|---|---|
Missing href attribute |
Link won't work | Always include href |
Forgetting http:// or https:// |
Link may try to open as a local file | Use full URL: https://google.com |
Not using target="_blank" |
User leaves your site | Use target="_blank" |
| Using "click here" as link text | Poor accessibility and SEO | Use descriptive link text |
Not adding security rel attribute |
Security risk | Use rel="noopener" with _blank |
<a> is the anchor tag used for creating hyperlinks.href attribute is required for the link to work.target="_blank" for external links to open in a new tab.rel="noopener" with target="_blank".You have successfully:
href, target, and title attributes.href attribute for links. Use target="_blank" for external links to keep users on your site. Use descriptive link text (not "click here") for better accessibility and SEO. Add rel="noopener" for security when using _blank.
ایک HTML ویب صفحہ بنانا جو تین مختلف ویب سائٹس کے لیے ہائپر لنکس بنانے کا طریقہ <a> (اینکر) ٹیگ کے ساتھ مناسب صفات اور اسٹائلنگ کے ساتھ ظاہر کرتا ہے۔
اس عملی میں، آپ تین مختلف ویب سائٹس کے لنکس بنائیں گے۔ ویب سائٹس ہو سکتی ہیں:
target="_blank" استعمال کریں تاکہ وہ نئی ٹیب میں کھلیں، جس سے آپ کا صفحہ صارف کے لیے کھلا رہے۔ وضاحتی لنک ٹیکسٹ استعمال کریں تاکہ صارفین کو معلوم ہو کہ کیا توقع کرنی ہے۔
| طریقہ | وضاحت | کے لیے بہترین |
|---|---|---|
| بٹن طرز | کلک کرنے کے قابل بٹنوں کے طور پر اسٹائل شدہ لنکس | ایکشن کے لیے کال، نیویگیشن |
| فہرست طرز | فہرست کی شکل میں منظم لنکس | وسائل کی فہرستیں، ڈائریکٹریز |
| گرافیکل کارڈز | آئیکنز اور وضاحتوں کے ساتھ لنکس | فیچر گرڈز، ہوم پیجز |
| سادہ متن | href کے ساتھ سادہ ٹیکسٹ لنکس |
ان لائن لنکس، پیراگراف |
| صفت | مقصد | مثال |
|---|---|---|
href |
منزل کا URL (ضروری) | href="https://google.com" |
target |
لنک کہاں کھلنا ہے | target="_blank" |
title |
ہوور پر ٹولٹپ متن | title="گوگل ملاحظہ کریں" |
rel |
لنک شدہ صفحے سے تعلق | rel="noopener" |
| غلطی | یہ کیوں غلط ہے | صحیح طریقہ |
|---|---|---|
href صفت غائب |
لنک کام نہیں کرے گا | ہمیشہ href شامل کریں |
http:// یا https:// بھول جانا |
لنک مقامی فائل کے طور پر کھلنے کی کوشش کر سکتا ہے | مکمل URL استعمال کریں: https://google.com |
target="_blank" کا استعمال نہ کرنا |
صارف آپ کی سائٹ چھوڑ دیتا ہے | target="_blank" استعمال کریں |
| "click here" کو لنک ٹیکسٹ کے طور پر استعمال کرنا | خراب رسائی اور SEO | وضاحتی لنک ٹیکسٹ استعمال کریں |
سیکیورٹی rel صفت شامل نہ کرنا |
سیکیورٹی خطرہ | _blank کے ساتھ rel="noopener" استعمال کریں |
<a> ہائپر لنکس بنانے کے لیے استعمال ہونے والا اینکر ٹیگ ہے۔href صفت لنک کے کام کرنے کے لیے ضروری ہے۔target="_blank" استعمال کریں تاکہ نئی ٹیب میں کھلے۔target="_blank" کے ساتھ rel="noopener" استعمال کریں۔آپ نے کامیابی سے:
href، target، اور title صفات کا استعمال کیا۔href صفت شامل کریں۔ صارفین کو آپ کی سائٹ پر رکھنے کے لیے بیرونی لنکس کے لیے target="_blank" استعمال کریں۔ بہتر رسائی اور SEO کے لیے وضاحتی لنک ٹیکسٹ استعمال کریں ("یہاں کلک کریں" کے بجائے)۔ سیکورٹی کے لیے _blank استعمال کرتے وقت rel="noopener" شامل کریں۔