I am trying to make a gallery-type page with 4 images side by side that scales in size depending on the screen size. I am using this guide: https://www.w3schools.com/howto/howto_css_image_responsive.asp
Currently I can make it work with just 1 image but as I have several images side by side (float:left) they don't scale anymore until it's scaled down to the point of just being 1 image seen from a left-right perspective.
This is the page I am working on: https://medielab.dk/index.php
Here is the html code:
<div id="content-1">
<img src="images/400px.png" class="responsive" width="600" height="400">
<img src="images/400px.png" class="responsive" width="600" height="400">
<img src="images/400px.png" class="responsive" width="600" height="400">
<img src="images/400px.png" class="responsive" width="600" height="400">
</div> <!-- content-1 luk -->
And here is the css:
#content-1 {
height:400px;
width:auto;
border-radius: 1px;
border-style: solid;
}
#content-1-box-1 {
height:auto;
width:auto;
border-radius: 1px;
border-style: solid;
border-color: #ff9de1;
float:left;
}
#content-1-box-2 {
height:auto;
width:auto;
border-radius: 1px;
border-style: solid;
border-color: #ff9de1;
float:left;
}
#content-1-box-3 {
height:auto;
width:auto;
border-radius: 1px;
border-style: solid;
border-color: #ff9de1;
float:left;
}
#content-1-box-4 {
height:auto;
width:auto;
border-radius: 1px;
border-style: solid;
border-color: #ff9de1;
float:left;
}
.responsive {
width: 100%;
max-width: 300px;
height: auto;
}