9. HTML Image adding tutorial

First of all this is html image adding tutorial.Images square measure important to beautify further on depict several complicated ideas in easy method on your online page. This tutorial can take you thru easy steps to use pictures in your websites.

Insert Image

You can insert any image in your online page by victimization <img> tag. Following is that the easy syntax to use this tag.

html image adding

(html image adding)

The <img> tag is associate empty tag, which suggests that, it will contain solely list of attributes and it’s no closing tag.

Example

<!DOCTYPE html>
<html>
<head>
<title>Using Image in Webpage</title>
</head>
<body>
<p>Simple Image Insert</p>
<img src="test.png" alt="Test Image" />
</body>
</html>
You can use PNG, JPEG or GIF image file supported your comfort however certify you specify correct image file name in src attribute. Image name is usually case sensitive.The angular position attribute could be a obligatory attribute that specifies associate alternate text for a picture, if the image can’t be displayed.

Set Image Location

Usually we tend to keep all the photographs during a separate directory. therefore let’s keep markup language file take a look at.htm in our home directory and make a directory pictures within the house directory wherever we are going to keep our image take a look at png.

<!DOCTYPE html>
<html>
<head>
<title>Using Image in Webpage</title>
</head>
<body>
<p>Simple Image Insert</p>
<img src="images/test.png" alt="Test Image" />
</body>
</html>

Set Image Width/Height

You can set image dimension and height supported your demand mistreatment dimension and height attributes. you’ll specify dimension and height of the image in terms of either pixels or proportion of its actual size.
<!DOCTYPE html>
<html>
<head>
<title>Set Image Width and Height</title>
</head>
<body>
<p>Setting image width and height</p>
<img src="test.png" alt="Test Image" width="150" height="100"/>
</body>
</html>

Set Image Border

By default, image can have a border around it, you’ll specify border thickness in terms of pixels exploitation border attribute. A thickness of zero suggests that, no border round the image.

<!DOCTYPE html>
<html>
<head>
<title>Set Image Border</title>
</head>
<body>
<p>Setting image Border</p>
<img src="test.png" alt="Test Image" border="3"/>
</body>
</html>

Set Image Alignment

By default, image can align at the left aspect of the page, however you’ll be able to use align attribute to line it within the center or right.

<!DOCTYPE html>
<html>
<head>
<title>Set Image Alignment</title>
</head>
<body>
<p>Setting image Alignment</p>
<img src="test.png" alt="Test Image" border="3" align="right"/>
</body>
</html>

This was all about html image adding.Our next tutorial is about html table.Read it here HTML Table Tutorial for Beginners.

Comments

comments