Html Tags

Html Tags

HTML <a> tag :

The HTML <a> tag, or anchor tag, is used to create hyperlinks in a web page. Here's the basic syntax of the <a> tag:

<a href="URL">Link Text</a>

  • href: This attribute specifies the URL of the page the link goes to. It can be an absolute URL (starting with "http://", "https://", etc.) or a relative URL.

  • Link Text: This is the text that will be displayed as the link.

Here's an example of how you can use the <a> tag to create a hyperlink:

<html> <head> <title>Example</title> </head> <body> <p>Visit our <a href="https://www.w3schools.com/">w3school</a> for more information.</p> </body> </html>

The <b> tag in HTML is used to make text bold. Here's a simple example of how it's used:

htmlCopy code<p>This is <b>bold</b> text.</p>

In this example, the word "bold" will be displayed in bold text.

However, it's important to note that the <b> tag is considered a presentational element, and its usage is not recommended for semantic markup. Instead, it's better to use the <strong> tag for emphasizing text semantically, as it carries more meaning for accessibility and search engine optimization:

htmlCopy code<p>This is <strong>strong</strong> text.</p>

Both <b> and <strong> will visually render text in bold, but <strong> carries more weight in terms of meaning.

The <img> tag in HTML is used to embed images into a webpage. Here's a basic example of how it's used:

htmlCopy code<!DOCTYPE html>
<html>
<head>
    <title>Image Example</title>
</head>
<body>

    <h2>Example Image</h2>
    <img src="image.jpg" alt="Description of the image">

</body>
</html>

In this example:

  • The <img> tag is used to include an image.

  • The src attribute specifies the URL of the image. This can be a relative or absolute path to the image file.

  • The alt attribute provides alternative text for the image, which is displayed if the image cannot be loaded or by screen readers for accessibility.

You can also specify the width and height of the image using the width and height attributes, like this:

htmlCopy code<img src="image.jpg" alt="Description of the image" width="200" height="150">

However, it's generally recommended to specify the dimensions of the image using CSS for better flexibility and responsiveness.

THANKYOU