Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to place one photo on the left edge and the other in the center of the page?

I have two image files and
I want to arrange the two like the image but I don’t know how…
enter image description here

HTML

<div class="header">
        <img class="header_menu" src={ic_menu} alt="" />
        <img class="header_logo" src={logo_image} alt="" />
</div>

CSS

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

.header {
  display:flex;
  justify-content: center;
}

.header_logo {
    vertical-align:bottom;
    display:flex;
    width: 300px;
  align-items: flex-end
}

.header_menu {
  display:flex;
  vertical-align:bottom;
  text-align: left;
  width: 30px;
  height: 30px;
  align-items: flex-end;
}

>Solution :

I would use float left for the logo, and hmm maybe position absolute will do better.

.header {
  display: flex;
  justify-content: center;
  position: relative;
  border: 1px solid red;
}

.header_logo {
  vertical-align: bottom;
  display: flex;
  width: 300px;
  align-items: flex-end
}

.header_menu {
  position: absolute;
  width: 30px;
  height: 30px;
  left: 0;
  bottom: 0;
}

img {
  border: 1px solid yellow;
  height: 50px;
}
<div class="header">
  <img class="header_menu" src={ic_menu} alt="" />
  <img class="header_logo" src={logo_image} alt="" />
  <div style="clear:both"></div>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading