HTML ATTRIBUTES IMG tag and A tag

 

<!DOCTYPE html>
<html lang=”en”>
<body>

<h2>Width and Height Attributes</h2>

<p>SEE here width and height attrbute of an image tag</p>

<p title=”Para title”>This is a paragraph.</p>

<img src=”image.jpg” width=”500″ height=”600″ alt=”The
computers”>

<h1><p style=”color:red;”>This is a
blueparagraph.</p></h1>

<a href=”//techlee.org”>Visit our HTML tutorial</a>

</body>
</html>

<IMG> and <a> tags

Tag <img>

Is used to include an image on the Webpage

Attribute- src=”image.jpg”

Other attributes

HEIGHT
WIDTH
ALT

See the code to see it is used and the video to see it in working.

HTML attributes provide additional information about HTML elements.

HTML ATTRIBUTES

  • All HTML elements can have attributes
  • These Attributes provide additional information about elements
  • Attributes are always specified in the start/opening tag
  • Attributes usually come in name and value pairs like: name=”value”

<a> and its href attribute

<a href=”//techlee.org”>Visit our HTML tutorial</a>

Lang attribute

It is a tag that comes with <html> tag. It defined the language used in the webpage.

<html lang=”en”>

Style attribute

style attribute is used to add styles to an element, such as color, font, size, and more

<p style=”color:red;”>This is a
blueparagraph.</p>

Title attribute

title attribute defines some extra information about an element

<p title=”Para title”>This is a paragraph.</p>

see the video to see the code working or do it by yourself.

see the code above and the video to see the code in working

  • All HTML elements can have attributes
  • the src attribute of <img> specifies the path to the image to be displayed
  • The href attribute of <a> specifies the URL of the page the link goes to
  • The width and height attributes of <img> provide size info for images
  • The alt attribute of <img> gives an alternate text for an image
  • The style attribute is used to add styles to an element, such as color, font, size, and more
  • The lang attribute of the <html> tag declares the language of the Web page
  • The title attribute defines some extra information about an element
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *