On my webpage, I have two divs positioned side by side with images inside them. Everything looks perfect when viewed on my Macbook 13 inch screen, but as I resize the browser window, the photos start to spread apart and create a large gap between them.
Is there a way to keep both photos aligned side by side even when the browser page width changes?
.pic {
max-width: 100%;
}
#pic2 {
max-width: 100%;
}
.photosection {
background-color: black;
max-width:1400;
height:363px;
}
#photosection1 {
float:left;
max-width: 110vw;
}
#photosection2 {
max-width:50%;
float:right;
}
<div class="photosection">
<div id="photosection1">
<a href="#" class="">
<span class="text">
Treat Yourself
Intuitive Language Coaching
(Intuitive Life-Coaching + Communication Training)
</span>
<img class="pic" src="images/oneonone.jpg" alt="inspiremug">
</a>
</div>
<div id="photosection2">
<a href="" class="">
<span class="text">
Treat Your Group, Business or Organization
I'll bring the sweets!
</span>
<img id="pic2" src="images/groupsession.jpg" alt="necklace">
</a>
</div>
</div>