-->

HTML page to work with picture tag

We have following example to understand about picture tag.
----------------------------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
HTMl with picture tag
</title>
</head>
<body><!--it is a container-->
<!--tag to display different picture-->
<!--that fits best to the browser-->
<!--the picture is chosen by the browser depending upon
the device or view.
-->
  <picture>
  <!-- we are using two pictures-->
  <!--which one to chose, it is decided by browser-->
  <!--depending upon device or view-->
  <source srcset="coffee.jpg">
  <source srcset="glass.jpg">
  <!--we use <img src...>at the end because
  if none of the src matched or
  if the browser does not support <picture> tag.
  then browser uses picture  with this im src.
  -->
  <img src="picture.jpg" alt="Beatles" style="width:auto;">
</picture>
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
<!--it repeats the picture-->
<!-- to avoid it we use css.We will learn in css unit-->
</body>
</html>
--------------------------------------------------------------------------------
note: please store the picture in same folder as that html is.
To understand clearly, read the comment section.
 

HTML page with map tag and attribute default

Let's see following example.
--------------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
inserting map with circle
'map' means a part of image where we can have link or we can click
</title>
</head>
<body><!--it is a container-->
<img src="coffee.jpg" width="400px" height="400px" alt="building" usemap="#coffeeecen">
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
<!--usemap attribute is used for picture's part we want to click-->
<!--we use hash tag for this-->
<map name="coffeeecen">
<area shape="default" alt="Computer" href="glass.html">
</map>
<!--we use mapname tag to connect specific area of picture-->
<!--we can use shape either rect or polygon or circle or default
-->
<!-- if we use default it would use entire region-->
<!--coords is for x and y value/coordinate-->
<!--values appear in pair(x and y)-->
<!--href is for that page which we want to be opened-->
</body>
</html>

 ------------------------------------------------------------------------
please read the comments section below the code.

HTML page with map tag and attribute circle

To understand about map tag, read following example.
---------------------------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
inserting map with circle
'map' means a part of image where we can have link or we can click
</title>
</head>
<body><!--it is a container-->
<img src="coffee.jpg" width="400px" height="400px" alt="building" usemap="#coffeeecen">
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
<!--usemap attribute is used for picture's part we want to click-->
<!--we use hash tag for this-->
<map name="coffeeecen">
<area shape="poly" coords="41,1,40,6,43,17,50,32
58,38,124,33,145,35,152,25,156,19,158,0" alt="Computer" href="glass.html">
</map>
<!--we use mapname tag to connect specific area of picture-->
<!--we can use shape either rect or polygon or circle or default
-->
<!-- if we use default it would use entire region-->
<!--coords is for x and y value/coordinate-->
<!--values appear in pair(x and y)-->
<!--href is for that page which we want to be opened-->
</body>
</html>

 -----------------------------------------------------------------------
Note: 
please read the comments written below the code.

HTML page with map tag and attributes

Let's see following example.
---------------------------------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
inserting map with circle
'map' means a part of image where we can have link or we can click
</title>
</head>
<body><!--it is a container-->
<img src="coffee.jpg" width="400px" height="400px" alt="building" usemap="#coffeeecen">
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
<!--usemap attribute is used for picture's part we want to click-->
<!--we use hash tag for this-->
<map name="coffeeecen">
<area shape="circle" coords="250,149,60" alt="Computer" href="glass.html">
</map>
<!--we use mapname tag to connect specific area of picture-->
<!--we can use shape either rect or polygon or circle or default
-->
<!-- if we use default it would use entire region-->
<!--coords is for x and y value/coordinate-->
<!--values appear in pair(x and y)-->
<!--href is for that page which we want to be opened-->
</body>
</html>

 

HTML page to work with map tag

Let's see following example.
----------------------------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
inserting map
'map' means a part of image where we can have link or we can click
</title>
</head>
<body><!--it is a container-->
<img src="coffee.jpg" width="400px" height="400px" alt="building" usemap="#coffeeecen">
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
<!--usemap attribute is used for picture's part we want to click-->
<!--we use hash tag for this-->
<map name="coffeeecen">
<area shape="rect" coords="40,2,166,49" alt="Computer" href="glass.html">
</map>
<!--we use mapname tag to connect specific area of picture-->
<!--we can use shape either rect or polygon or circle or default
-->
<!-- if we use default it would use entire region-->
<!--coords is for x and y value/coordinate-->
<!--values appear in pair(x and y)-->
<!--href is for that page which we want to be opened-->
</body>
</html>

 ----------------------------------------------------------------------
note:
Read the comments section written on side.

HTML page to click the certain part of picture using map tag

Let's be clear with following code.
-----------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
inserting map
'map' means a part of image where we can have link or we can click
</title>
</head>
<body><!--it is a container-->
<img src="coffee.jpg" width="400px" height="400px" alt="building" usemap="#coffeeecen">
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
<!--usemap attribute is used for picture's part we want to click-->
<!--we use hash tag for this-->
<map name="coffeeecen">
<area shape="rect" coords="40,2,166,49" alt="Computer" href="glass.html">
</map>
<!--we use mapname tag to connect specific area of picture-->
<!--we can use shape either rect or polygon or circle or default
-->
<!-- if we use default it would use entire region-->
<!--coords is for x and y value/coordinate-->
<!--values appear in pair(x and y)-->
<!--href is for that page which we want to be opened-->
</body>
</html>

 ---------------------------------------------------------------------------------------
First store that picture in a folder.

HTML page to insert image with attributes

we can apply different attributes to inserted image. Let's be clear with following example.
-------------------------------------------------------------------------------------------------
<html> <!--called root tag-->
<head> <!--it is used for meta tags-->
<title><!-- it is used for title of page-->
inserting image
</title>
</head>
<body><!--it is a container-->
<img src="picture\picture1.jpg" width="400px" height="400px" alt="building">
<!--img src is used to insert image-->
<!-- it has attributes width,height and alt-->
<!-- 'alt' is used if the picture could not be loaded/displayed-->
<!--we must make sure that the path(of image) is correct-->
</body>
</html>



---------------------------------------------------------------
note:-
Make sure that we have picture in same folder as html is.