Explore my CodePen project here
Greetings, I am currently working on creating a grid layout showcasing 6 links to various projects. Each link is comprised of an image template along with a detailed text description below it. The parent container for each of the 6 templates has been defined with grid-template-rows:0.7fr .3fr;
. However, there seems to be an issue with the texted description element as it is not staying within the designated container. Can anyone provide insight into why this might be happening? Any assistance would be greatly appreciated, thank you! (:
<style>
.projects-section{
background:var(--main-blue);
display:grid;
padding:7rem 2rem;
}
.projects-section-header{
align-self:start;
max-width:800px;
color:var(--main-white);
text-align:center;
border-bottom:.5rem solid var(--main-white);
margin: 6rem auto;
}
.tilescontainer{
justify-self:center;
width:70%;
display:grid;
grid-gap:20px;
grid-template-columns:repeat(3,1fr);
grid-template-rows:repeat(2,300px) 75px;
}
.project-tile{
border:1px solid white;
display:grid;
grid-template-columns:1fr;
grid-template-rows:0.7fr .3fr;
grid-template-areas:
"tiletemplate"
"tiletitle"
}
.title-bg{
grid-area:tiletitle;
background-color:var(--main-gray);
width:100%;
opacity:0.85;
}
.tile-image{
width:100%;
height:70%;
}
.tile-title{
color:var(--main-white);
text-transform:capitalize;
font-weight:100;
font-size:smaller;
}
#showallcontainer{
grid-column:2/3;
grid-row:3/4;
display:grid;
width:100%;
justify-content:center;
align-content:center;
}
.showall{
background:var(--main-gray);
padding:0.5rem 2.5rem;
opacity:0.85;
}
</style>
<body>
<section id="projects" class="projects-section">
<h2 class="projects-section-header">Behold some of my latest projects</h2>
<div class="tilescontainer">
<div class="project-tile">
<img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/tribute.jpg" alt="Dr. Norman Borlaug" class="tile-image">
<div class="title-bg">
<h4 class="tile-title">Tribute Page</h4>
</div>
</div>
<div class="project-tile">
<img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/random-quote-machine.png" alt="Quotes" class="tile-image">
<div class="title-bg">
<h4 class="tile-title">Random Quote Machine</h4>
</div>
</div>
<div class="project-tile">
<img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/calc.png" alt="JavaScript Calculator" class="tile-image">
<div class="title-bg">
<h4 class="tile-title">JavaScript Calculator</h4>
</div>
</div>
<div class="project-tile">
<img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/map.jpg" alt="Map Data" class="tile-image">
<div class="title-bg">
<h4 class="tile-title">Mapping Data Across the Globe</h4>
</div>
</div>
<div class="project-tile">
<img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/wiki.png" alt="WikiViewer" class="tile-image">
<div class="title-bg">
<h4 class="tile-title">Wikipedia Viewer</h4>
</div>
</div>
<div class="project-tile">
<img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/tic-tac-toe.png" alt="Tic-Tac-Toe" class="tile-image">
<div class="title-bg">
<h4 class="tile-title">Tic Tac Toe Game</h4>
</div>
</div>
<div id="showallcontainer">
<h4 class="tile-title showall">Show All <i>></i></h4>
</div>
</div>
</section>
</body>