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

Images are vertical instead of horizontal

I can’t get my images to align horizontally. Instead they align under one another.
I am making this code from W3Schools.com.
I tried flex, float and other solutions on the web.
I am making this for my homepage to showcase some of my photos.

.column {
  float: left;
  width: 500px;
  padding: 10px;
}

.column img {
  opacity: 0.8;
  width: 150px;
  cursor: pointer;
}

.column img:hover {
  opacity: 1;
}

.row:after {
  content: "";
  display: table;
  clear: both;
}

.container {
  position: relative;
  display: none;
}

#imgtext {
  position: absolute;
  bottom: 15px;
  left: 15px;
  color: white;
  font-size: 20px;
}

.closebtn {
  position: absolute;
  top: 10px;
  right: 15px;
  color: white;
  font-size: 35px;
  cursor: pointer;
}
<div class="row">
  <div class="column">
    <img src="https://picsum.photos/150/150" alt="F35C Parked" onclick="myFunction(this);">
  </div>
  <div class="column">
    <img src="https://picsum.photos/150/150" alt="F16 Venom" onclick="myFunction(this);">
  </div>
  <div class="column">
    <img src="https://picsum.photos/150/150" alt="EuroFighter Landing" onclick="myFunction(this);">
  </div>
</div>
<div class="container">
  <span onclick="this.parentElement.style.display='none'" class="closebtn">&times;</span>

  <img id="expandedImg" style="width:100%">

  <div id="imgtext"></div>
</div>

>Solution :

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

.row {display: flex;}

That’s all you need.

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