How to add Images in HTML & CSS

How to add Images in the HTML

Want to know how to add Images to the HTML file?
Adding images are the good idea to make web page more attractive and cool.  You can add images to your web page in two ways either as a background or as an image.
·        As an image you need to add simply : 
<img src =”path of image”> ‘ . Here img =image and src = source .
·        For adding as a background you can use css file and write :
                   ‘ background : url (‘Path/url of the image’);
In CSS you can use some properties :
1.    ‘ background : url (‘Path/url of the image’) no-repeat; ‘
2.    ‘ background : url (‘Path/url of the image’) repeat; ‘
3.         Background-size : cover ;

//** HTML code for adding images **//
<!DOCTYPE html>
<html>
<head>
          <title>Intoduction</title>
          <link rel="stylesheet" type="text/css" href="style/intro.css">
</head>
<body>
<header id="head"><img src="..\Youtube\image\download.png"><h2>Coder99</h2></header>
</body>
</html>
Check out For Better understanding[English]
Check for Hindi tutorial 

//** CSS file saved as intro.css **//
body
{
          margin: 0px;
          background: url("C:Users/vivek dubey//Desktop/Youtube/image/circuit.jpg");
          background-size: cover;
}
h2
{
          display: inline;
}
#head
{
          background :url("C:/Users/vivek dubey/Desktop/Youtube/image/circuit.jpg") ;
          color: white;
          padding: .5em;
          margin-bottom: 2px;
}
img
{
          height: 5em;
          width: 5em;
}

//** save and enjoy your images **//

Comments