Anchor and Image tags in HTML | Code2night.com
Code2night
  • Home
  • Blogs
  • Guest Posts
  • Tutorial
  • Post Blog
  • Register
  • Login
  1. Home
  2. Blogpost

Anchor and Image tags in HTML

Date- Dec 09,2023

1496

1.<a> (Anchor Tag):

  • a). The<a> tag is used to create hyperlinks, which allow users to navigate to other web pages or resources by clicking on the linked text or image.
  • b). The primary attribute used with the<a> tag is href (hypertext reference), which specifies the URL of the linked resource.
  • c).You can use the <a> tag to link to other web pages, external websites, local files, email addresses, and more.

Example:-

<a href="https://www.example.com">Visit google.com</a>


In this example, the <a> tag creates a hyperlink that, when clicked, takes the user to the "https://www.google.com" web page.

The<a> tag can also be used with an optionaltarget attribute to control how the linked resource is displayed (e.g., in a new browser window or tab). For example:

<a href="https://www.google.com" target="_blank">Visit google.com in a new tab</a>

2. <img> (Image Tag):

  • a).The<img> tag is used to embed images in web pages. It allows you to display images on a web page by specifying the image file's source (URL).
  • b). The primary attribute for the<img> tag is src (source), which specifies the URL of the image file.
  • c).Additionally, you can use thealt attribute to provide alternative text for the image. This text is displayed if the image cannot be loaded or if a user is using a screen reader.
  • Example:
  • <img src="image.jpg" alt="An example image">
  • In this example, the <img> tag embeds an image from the file "image.jpg" and provides alternative text.

    You can also specify other attributes to control the image's width, height, alignment, borders, and more. For instance:

    <img src="image.jpg" alt="An example image" width="200" height="150" border="1" align="right">

    These attributes control the image's dimensions, border, and alignment.

    Both the <a> and <img> tags are widely used in web development to create hyperlinks and display images, respectively. They are essential for enhancing the interactivity and visual appeal of web pages.



    Result:-










Comments

Tags

LinkedinLogin
LinkedinProfile
GetLinkedinProfile
C#
Aspnet
MVC
Linkedin
ITextSharp
Export to Pdf
AspNet Core
AspNet
View to Pdf in Aspnet
Model Validation In ASPNET Core MVC 60
Model Validation
Model Validation In ASPNET Core MVC
Model Validation In ASPNET
Image Compression in AspNet
Compress Image in c#
AspNet MVC
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1190
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Panipat
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2025 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Terms & Conditions
  • Refund Policy
  • About Us
  • Privacy Policy
  • Json Beautifier
  • Guest Posts