CSS Layout How to - Align images in a row








Question

We would like to know how to align images in a row.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.divPortfolioImageRowFirst {<!--from  w w w .j ava2  s . c om-->
  border: 2px dotted gray;
  padding: 10px;
}

.divPortfolioImageCol1 {
  border: 1px dotted gray;
}

.divPortfolioImageCol1 img {
  vertical-align: top;
}
</style>
</head>
<body>
  <div id="divProductLogos">
    <div class='divPortfolioImageRowFirst'>
      <div class='divPortfolioImageCol1'>
        <img src="http://placekitten.com/150/200" /> <img
          src="http://placekitten.com/150/250" /> <img
          src="http://placekitten.com/250/150" />
      </div>
    </div>
  </div>
</body>
</html>

The code above is rendered as follows: