Monday, 25 September 2023

Images in HTML

 

How to add an Image in HTML..?

How to add an image in HTML code..?

  • <img>  Tag

Output:-

Graduated Girl




HTML Code:-

<!DOCTYPE html>
<html>
<body>

<h2>Graduated Girl</h2>

<img src="https://www.heirloomportraits.ca/usercontent/services/graduation-portraits/grad7.jpg" alt="Graduated Girl in UOW">
  
</body>
</html>

  • alt  

<alt> can be used to display text when an image is not visible.



How to set an image height & width in HTML..?

  • width & height

Output:-

Graduated Girl




HTML Code:-

<!DOCTYPE html>
<html>
<body>

<h2>Graduated Girl</h2>

<img src="https://www.heirloomportraits.ca/usercontent/services/graduation-portraits/grad7.jpg" alt="Graduated Girl in UOW" width="600" height="300">
  
</body>
</html>



Written by:  W.A. Eranga Dewmini

No comments:

Post a Comment

Java Script Learning

 Introduction to JavaScript JavaScript is the programming language used by front-end web developers to instruct the browser to add behaviors...