View Single Post
Old 03-26-2024, 11:04 AM   #6
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,338
Karma: 105899727
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Have the outer div have CSS in its class to set left & right margins and padding 0 and center

HTML
Code:
<div class="centred-stuff">
  <img class="img-1" alt="" src="../Images/img_1.png"/>
  <img class="img-2" alt="" src="../Images/img_2.png"/>
  <img class="img-3" alt="" src="../Images/img_3.png"/>
  <img class="img-4" alt="" src="../Images/img_4.png"/>
</div>
Using <p class="centred-stuff"> (with a closing </p>) can work well instead of div and suit non-heading centred text.

I would use <p>

CSS
Code:
.centred-stuff {
   margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    text-align: center
}

.img-1 {
  height: 100 px;
  width: auto;  /* or exact pixels */
  padding-right: 5px;
}

No padding on the last image on the line. 
If you use "pt" instead of "px" some renderers might change the image size as user changes font size!
You can space images in the one <p> tag using a single space.
Quoth is offline   Reply With Quote