What I am trying to do is position text over these images. I want them to be in the bottom left corner but whatever I try, nothing seems to get them to work. I am able to change their size and color and padding but I am not able to place them where I want in the div. Any suggestion helps and I appreciate it all! Thankyou
HTML:
<div class="grid">
<div class="f f1">
<h3>My Beautiful Dark Fantasy</h3>
</div>
<div class="f f2">
<h3>My Beautiful Dark Fantasy</h3>
</div>
<div class="f f3">
<h3>My Beautiful Dark Fantasy</h3>
</div>
<div class="f f4">
<h3>My Beautiful Dark Fantasy</h3>
</div>
<div class="f f5">
<h3>My Beautiful Dark Fantasy</h3>
</div>
</div>
CSS
html {
height: 100%;
box-sizing: border-box;
}
body {
position: relative;
margin: 0;
padding-bottom: 6rem;
min-height: 100%;
font-family: "Helvetica Neue", Arial, sans-serif;
}
.nav {
background: #ddd;
padding: 20px;
margin: 0;
}
.nav a {
padding: 10px;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 350px;
margin: 30px 150px 30px 150px;
position: relative;
}
.f {
width: 100%;
height: 100%;
position: relative;
background-repeat: no-repeat;
background-size: cover;
background-color: grey;
}
.f h3{
color: white;
margin: 0;
padding: 10px;
}
.f1 {
grid-column: 1/3;
grid-row: 1/3;
background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
url("/images/album/tyler.jpg");
}
.f2 {
grid-column: 3/4;
grid-row: 1/2;
background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
url("/images/album/dope.jpg");
}
.f3 {
grid-column: 3/4;
grid-row: 2/4;
background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
url("/images/album/kanye.jpg");
}
.f4 {
grid-column: 1/2;
grid-row: 3/4;
background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
url("/images/album/selfie.jpg");
}
.f5 {
grid-column: 2/3;
grid-row: 3/4;
background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
url("/images/album/fantasy.jpg");
}
.footer {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
background-color: #efefef;
text-align: center;
}
