how to add image in header html code example

Example 1: html how to add an image

<img src="flowers.jpg" alt="flowers">

//Always add the image type (jpg,png, etc) Adding alt text
is also good coding practice :)

Example 2: images in html

<html>
  <head>
  </head>
	<body>
  <img src="exampel.end">
    </img>
  </body>
  
  
  </html>

Example 3: html how to insert image

<!--When the image is in the same folder as your html file-->
<img src="example.jpg">
<!--When the image is in a image folder-->
<img src="./image/example.jpg">

Example 4: add image under header html

<div class="container">
  <header>
    <h2>Header Text</h2>
  </header>
  <div class="banner"></div>
  <div class="content">
    <h3>Content</h3>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
      in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
    </p>
  </div>
  <div class="banner"></div>
</div>

Example 5: add image under header html

.container {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.banner {
  height: 100px;
  background: url(https://dreaminginyellow.com/diy-custom-design-yellow-strips/) bottom center no-repeat
}

Tags:

Html Example