How to add images in a web page


Adding images to your web page :

HTML let you display images in web page by using <img> tag. <img> tag doesn't have closing tag.

<img> tag
Images can be inserted in web page by using <img> tag.
To display an image on a page, you need to use the src attribute. Src stands for 'source'. The value of the src attribute is the URL of the image you want to display on your page.
Following are the attributes of <img> tag:
Attributes DescriptionValues
align : Controls alignment of the image.top, bottom, middle, left, right
border : Sets the size of the border to be placed around the image. pixels
src : This is the main attribute of <img> tag.It contains URL of the image where image is located.URL
width : Controls width of the image.pixels, %
height : Sets height of the image.pixels, %
hspace : It indicates amount of space to be left at the left & right of the image.pixels
vspace : It indicates amount of space to be left at the top & bottom of the image.pixels
alt : It displays text when image fails to appear in the browser or when mouse pause over that image.text

The following eg. shows the use of <img> tag:
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nabOSa4V2GQDKRiO0lCWFfSmjBb9yxgDM2TKnUXWXcHej_tkTa-PoPO-AfVT8HCUQHxTHsTXpKy6HPHSbYJUBogeHG2zClXbxj5WhId9NkCh5DdHjkVS1kvwoMMOr85Jwo4WVmcLEAA1/s320/P70507-190500.jpg">
Output :


Image as hyperlink
Image can be act as hyperlink in the following way:
<a href="http://blogging-hacks.blogspot.com/"> <img src="img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nabOSa4V2GQDKRiO0lCWFfSmjBb9yxgDM2TKnUXWXcHej_tkTa-PoPO-AfVT8HCUQHxTHsTXpKy6HPHSbYJUBogeHG2zClXbxj5WhId9NkCh5DdHjkVS1kvwoMMOr85Jwo4WVmcLEAA1/s320/P70507-190500.jpg"></a>
Output :


You Might Also Like

0 comments

My photo
Hi. I am Ramesh Wetkoli. Three things I try to include in my blog posts are creativity, useful insights, and trendy information. IT graduate and working professional. I have leveraged 9+ years of work experience in IT industry and learnt various technologies, providing merchandizing support and handling digital marketing responsibilities.

Find us on Facebook