Dublicate part
I am trying to build a certain layout for a section in React application, the layout is similar to this image below, Ignore the lines on the right.
here is my HTML,
the boxes are empty for the moment, back to that later..
const projects = () => {
return (
<section className="projects">
<div className="container fcontainer">
<div className="fcol fcol--1">
<div className="box-1"></div>
<div className="box-2"></div>
</div>
<div className="fcol fcol--2">
<div className="box-1"></div>
<div className="box-1"></div>
<div className="box-1"></div>
</div>
<div className="fcol fcol--3">
<div className="box-1"></div>
<div className="box-2"></div>
</div>
</div>
</section>
)
}
.fcol {
color: #333;
margin: 1rem;
text-align: center;
font-size: 3rem;
display: flex;
flex-direction: column;
height: 60vh;
flex-grow: 4;
&--1 {
.box-1{
background-color: lightblue;
flex-grow: 1;
margin-bottom: 2rem;
}
.box-2{
background-color: lightgreen;
flex-grow: 2;
}
}
&--2 {
.box-1{
background-color: lightblue;
flex-grow: 1;
justify-content: space-between;
&:not(:last-child){
margin-bottom: 2rem;
}
}
}
&--3 {
.box-1{
background-color: lightblue;
flex-grow: 3;
margin-bottom: 2rem;
}
.box-2{
background-color: lightgreen;
flex-grow: 2;
}
}
}
this is a codepen for you guys to edit and fix the issue if you are interested, also feel free to change the HTML and scss entire structure if you have a better approach.
the Non-dublicate part
I am a little stuck in populating each box with an image as the image always overflow outside the box even if I manually set it's height
and width
to 100%
, nor does it work if I added the bootstrap class img-fluid
.
another error occures when importing and using images from the .scss file in my react app, check it out in the link, thats it, thanks very much for your time