Trying to center an image inside a DIV

Im at a loss and cannot make this image center inside the main div. Can anyone please help :slight_smile:

  <div class="headertop">
  <div class="container-fluid">
    <div class="row" >
      <div class="siteheader" >
        <div class="head_img" ><img class="img-fluid" src="../images/design1.jpg" width="855px"> 


.headertop {
background-color: #e9edf0;
width: 100%;

.siteheader {
padding-top: 10px;
height: auto;
text-align: center;


.head_img img{
width: 855px;
height: 244px;
margin: 0 auto;
vertical-align: middle;


Hi there henk3,

a brief glance at your HTML begs the question:
why do you need five div elements to contain
one img element? :wonky:

Here is a basic example…

…and the code…


1 Like

there are other elements inside divs below the image

Anyway thank you - I simplified the div fiasco and applied what you gave me and its working.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.