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://3.bp.blogspot.com/-P5Y5UhTXJqc/WSsgqkK5LwI/AAAAAAAAFtw/4xQNWNZgLKgzhMY3zozWc4_2OsGWBnw_QCKgB/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://3.bp.blogspot.com/-P5Y5UhTXJqc/WSsgqkK5LwI/AAAAAAAAFtw/4xQNWNZgLKgzhMY3zozWc4_2OsGWBnw_QCKgB/s320/P70507-190500.jpg"></a>
Output :


You Might Also Like

0 comments

Follow by Email

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

Popular Posts

Find us on Facebook