I am attempting to create a compact gallery grid with three distinct elements as shown below:
----------------------- -----------------------
- - - -
- - - -
- - - element 2 -
- element 1 - - -
- - - -
- - -----------------------
- - -----------------------
- - - -
- - - -
- - - element3 -
- - - -
- - - -
- - - -
- - - - - - - - - - - - -----------------------
All of these elements are part of a CSS class called .gallery
, with element 2
and element 3
falling under the CSS class named .small
.
I initially tried coding this on my own, but I intend to implement it on a mobile site. While my current code is functional, resizing the browser window causes elements 2 and 3 to float left.
CSS:
.gallery li{
background: #ccc;
width:100px;
height: 100px;
margin: 1%;
list-style: none;
float: left;
}
.gallery .big{
height: 205px;
width:48%;
}
.gallery .small{
height:100px;
width: 48%;
}
HTML:
<div class="gallery">
<li class="big"></li>
<li class="small"></li>
<li class="small"></li>
</div>
I appreciate any assistance you can provide!