View Single Post
Old 03-26-2024, 10:04 AM   #5
swepub
Swepub
swepub began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Dec 2023
Device: iPad
Quote:
Originally Posted by Turtle91 View Post
You can use the float command in your css file:

Code:
CSS
.images  {clear:both; margin:2em 1em}
.floater {float:left; width:20%; margin:0}

HTML
<div class="images">
  <img class="floater" alt="" src="../Images/img_1.png"/>
  <img class="floater" alt="" src="../Images/img_2.png"/>
  <img class="floater" alt="" src="../Images/img_3.png"/>
  <img class="floater" alt="" src="../Images/img_4.png"/>
</div>
-OR-

Code:
CSS
.images     {clear:both; margin:2em 1em}
.images img {float:left; width:20%; margin:0}

HTML
<div class="images">
  <img alt="" src="../Images/img_1.png"/>
  <img alt="" src="../Images/img_2.png"/>
  <img alt="" src="../Images/img_3.png"/>
  <img alt="" src="../Images/img_4.png"/>
</div>
I prefer the 2nd one...it's a little cleaner.
I used your 2nd one and it works great. Just one more question - can you adjust the space between the images and center the two images?
swepub is offline   Reply With Quote