I’m attempting to get textual content be centered together with a picture, utilizing flexbox. The textual content is aligned correctly, however not the corresponding photos.
CSS:
physique { font-family:'Occasions New Roman', Occasions, serif;
show: flex;
flex-direction: column;
align-items: middle;
justify-content: middle; }
.infoheader { font-size: 36px;
font-weight: 300;
margin-bottom: 12px;
text-align: middle; }
.physique { show: flex;
hole: 10px;
text-align: middle;
justify-content: middle; }
.card { max-width: 200px; }
.fishes { peak: 100px;
width: 100px; }
HTML:
<physique>
<div class="infoheader">An Instance Assortment of Fishes:</div>
<div class="physique">
<div class="card">
<img class="fishes" src="./fishes/onefish.jpg" alt="humorous fish">
<div class="textual content">what would occur if i added a really very very lengthy line of textual content</div>
</div>
<div class="card">
<img class="fishes" src="./fishes/bluefish.jpg" alt="humorous fish">
<div class="textual content">That is some subtext beneath a picture.</div>
</div>
<div class="card">
<img class="fishes" src="./fishes/fish.jpg" alt="SEAL">
<div class="textual content">That is some subtext beneath a picture.</div>
</div>
<div class="card">
<img class="fishes" src="./fishes/twofish.jpg" alt="humorous fish">
<div class="textual content">That is some subtext beneath a picture.</div>
</div>
</div>
</physique>
By including
justify-content: middle;
text-align: middle
to .physique, I assumed that the picture and textual content could be centered with one another, however solely the textual content is centered and the photographs seem like they’re displaying barely to the left of the textual content.