Best Source of Web Development Tutorials, Articles, Programming Codes, Free PHP Scripts, PHP Tutorials and Much More
Login
Username:
Password:

Working with Images in HTML

Working with Images

By: programmersbank
Images are defined with <img> tag. The <img> tag is open tag, which means that it contains attributes only and it has no closing tag. <img> tag has following properties:

src: src stands for "source", the value of src attribute is url of images you want to display on your page For example.

<img src="img1.gif">

alt: The alt attribute is used to define an "alternate text" for an image, the value of alt attribute is user-defined text.The alt text is useful if image path is wrong.

<img src="img1.gif" alt="this is image">

height: This attribute is used define height of image

<img src="img1.gif" alt="this is image" height="70">

width: This attribute is used define width of image

<img src="img1.gif" alt="this is image" height="70" width="70" >

 

Example:

<HTML>
<HEAD>
<TITLE>This is image example</TITLE>
</HEAD>
<BODY>
<img src="img1.gif" alt="this is image" height="70" width="235" >
</BODY>
</HTML>

Tutorial Pages

Bookmark This Page