❐HTML❐

❐wD Learn

HTML

HTML Introduction

HTML Element

HTML Attributes

HTML Heading

HTML Paragraph

HTML Style

HTML Format

HTML Color

HTML Link

HTML Image

HTML Table

HTML List

HTML Symbols

HTML Emojis

HTML Forms

HTML Images
Images can improve the design and the appearance of a web page.

Example


<img src="css.jpg" alt="Italian Trulli">
HTML Images Syntax The HTML tag is used to embed an image in a web page.

Images are not technically inserted into a web page; images are linked to web pages.

The <img> tag is empty, it contains attributes only, and does not have a closing tag.

The <img> tag has two required attributes:
  • src - Specifies the path to the image
  • alt - Specifies an alternate text for the image

Example


<img src="img_hi.jpg" alt="Flowers ">
Image Size - Width and Height
You can use the style attribute to specify the width and height of an image.

Example


<img src="img_girl.jpg" alt="Girl in a jacket" style="width:500px;height:600px;">
HTML Background Images
To add a background image on an HTML element, use the HTML style attribute and the CSS background-image property:

Example


<p style="background-image: url('img_girl.jpg');">