Skip to content

Instantly share code, notes, and snippets.

@shubhnik
Created October 25, 2017 12:16
Show Gist options
  • Save shubhnik/a804c4cf59ceeca461759744139660ae to your computer and use it in GitHub Desktop.
Save shubhnik/a804c4cf59ceeca461759744139660ae to your computer and use it in GitHub Desktop.
App.js and App.css code
///////////////// App.js
class App extends Component {
render() {
return (
<div className="App">
<div style={{flex:1, minWidth:300, minHeight:300, backgroundColor:'green'}}>
<div className="imageConatiner">
<div className="imageDiv"/>
</div>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'red'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'yellow'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'blue'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'pink'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'orange'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'purple'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
<div style={{flex:1, minWidth:300, minHeight:300, justifyContent:'center', backgroundColor:'black'}}>
<div style={{backgroundColor:'yellow', width:200}}/>
</div>
</div>
);
}
}
////////////////////////App.css
.App {
display: flex;
background: red;
/*height: 400px;*/
flex-wrap: wrap;
justify-content: center;
}
.imageConatiner {
height: 100%;
padding: 10%;
justify-content: center;
align-items: center;
}
.imageDiv {
height: 100%;
background: greenyellow;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment