I'm a little confused with width
/height
and working with flexbox
. I've been trying to get each div
to be a purple square but it seems to crop to the size of the text. I'd like each colour to maintain a square shape when resized, but just get smaller in scale.
.dark-box
{
background: #8f6cda;
text-align: center;
text-decoration: none;
color: #ffffff;
font-family: 'verdana';
}
.med-box
{
background: #a68fd8;
text-align: center;
text-decoration: none;
color: #ffffff;
font-family: 'verdana';
}
.light-box
{
background: #b5a5d7;
text-align: center;
text-decoration: none;
color: #ffffff;
font-family: 'verdana';
}
.dark-box:hover, .med-box:hover, .light-box:hover
{
opacity: 0.5;
}
.dark-box a, .med-box a, .light-box a
{
text-decoration: none;
color: #ffffff;
font-family: 'verdana';
}
.col-md-2
{
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row;
transition: opacity .2s ease-in-out;
}
https://codepen.io/adms2000/pen/wvaaxNz
I'm also unsure why the text only centres when display: flex
is set as a property in the tile
class. Thanks!