I'm am trying to make a mosaique for a website. I would like the pictures to fit nicely their respective divs. I have tries many configurations but the pictures always seem to be overlapping and/or don't fit 100% of their respective divs. It seems that the pictures do'nt follow the pencentages I indicated.
body{
width:100%;
height: 100%;
}
#firstRow {
margin:4px;
display:flex;
height:40%;
width: 100%;
}
#secondRow {
margin:4px;
display:flex;
height:10%;
width: 100%;
}
#thirdRow {
margin:4px;
display:flex;
height:50%;
width: 100%;
}
.bigImageMosaique {
margin:4px;
position: relative;
width: 50%;
}
.mediumImageMosaique {
margin:4px;
position: relative;
width: 60%;
}
.smallImageMosaique {
margin:4px;
position: relative;
width: 40%;
}
img{
display:block;
width : 100%;
height: 100%;
}
h2{
position: absolute;
bottom:5%;
left:0;
width: 100%;
}
h2 span {
color: white;
font: bold 24px/45px;
letter-spacing: -1px;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0 ,0.7);
padding: 10px;
}
<!DOCTYPE html>
<html>
<style>
<?php include ("CSSMosaiqueSeule.css"); ?>
</style>
<body>
<div id="firstRow">
<div class="bigImageMosaique">
<img src="images\mosaiqueImage\bolt.jpg" alt=""/>
<h2><span> Je suis une légende vivante </span></h2>
</div>
<div class="bigImageMosaique">
<img src="images\mosaiqueImage\bolt.jpg" alt=""/>
<h2><span> Je suis une légende vivante </span></h2>
</div>
</div>
<div id="secondRow">
<div class="mediumImageMosaique">
<img src="images\mosaiqueImage\bolt.jpg" alt=""/>
<h2><span> Je suis une légende vivante </span></h2>
</div>
<div class="smallImageMosaique">
<img src="images\mosaiqueImage\bolt.jpg" alt=""/>
<h2><span> Je suis une légende vivante </span></h2>
</div>
</div>
<div id="thirdRow">
<div class="smallImageMosaique">
<img src="images\mosaiqueImage\bolt.jpg" alt=""/>
<h2><span> Je suis une légende vivante </span></h2>
</div>
<div class="mediumImageMosaique">
<img src="images\mosaiqueImage\bolt.jpg" alt=""/>
<h2><span> Je suis une légende vivante </span></h2>
</div>
</div>
</body>
</html>