Add grid item margins and sample text
This commit is contained in:
parent
fcae4371e6
commit
1bc64552c0
|
@ -1,3 +1,7 @@
|
|||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
|
13
src/Grid.css
13
src/Grid.css
|
@ -5,15 +5,22 @@
|
|||
}
|
||||
|
||||
.grid-item {
|
||||
background: #baffbd;
|
||||
background: linear-gradient(135deg, #87e0fd 0%,#53cbf1 40%,#05abe0 100%);
|
||||
position: relative;
|
||||
|
||||
float: left;
|
||||
|
||||
width: 30rem;
|
||||
min-width: 25rem;
|
||||
min-height: 25rem;
|
||||
padding-bottom: 30rem;
|
||||
}
|
||||
|
||||
//border-style: solid;
|
||||
//border-width: 5px;
|
||||
.grid-item-content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
@media all and (max-width: 120rem) {
|
||||
|
|
28
src/Grid.js
28
src/Grid.js
|
@ -1,15 +1,33 @@
|
|||
import React from 'react';
|
||||
import './Grid.css';
|
||||
|
||||
import logo from './logo.png';
|
||||
import GridItem from './GridItem';
|
||||
|
||||
class Grid extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className='grid-container'>
|
||||
<div className='grid-item'>test</div>
|
||||
<div className='grid-item'>test</div>
|
||||
<div className='grid-item'>test</div>
|
||||
<div className='grid-item'>test</div>
|
||||
<div className='grid-item'>test</div>
|
||||
<GridItem>
|
||||
<img src={logo} className="Home-logo" alt="logo" />
|
||||
<p>Links</p>
|
||||
<p>Links</p>
|
||||
<p>Links</p>
|
||||
<p>Links</p>
|
||||
<p>Links</p>
|
||||
</GridItem>
|
||||
<GridItem>
|
||||
<h1>Project 1</h1>
|
||||
</GridItem>
|
||||
<GridItem>
|
||||
<h1>Project 2</h1>
|
||||
</GridItem>
|
||||
<GridItem>
|
||||
<h1>Project 3</h1>
|
||||
</GridItem>
|
||||
<GridItem>
|
||||
<h1>Project 4</h1>
|
||||
</GridItem>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
15
src/GridItem.js
Normal file
15
src/GridItem.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import React from 'react';
|
||||
|
||||
class GridItem extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className='grid-item'>
|
||||
<div className='grid-item-content'>
|
||||
{this.props.children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default GridItem;
|
|
@ -7,7 +7,6 @@ class Home extends React.Component {
|
|||
render() {
|
||||
return (
|
||||
<div className='Home'>
|
||||
Hello world!
|
||||
<Grid />
|
||||
</div>
|
||||
);
|
||||
|
|
BIN
src/logo.png
Normal file
BIN
src/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in New Issue
Block a user