Add grid item margins and sample text

This commit is contained in:
Tanner Collin 2018-07-25 19:34:56 -06:00
parent fcae4371e6
commit 1bc64552c0
6 changed files with 52 additions and 9 deletions

View File

@ -1,3 +1,7 @@
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}

View File

@ -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) {

View File

@ -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
View 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;

View File

@ -7,7 +7,6 @@ class Home extends React.Component {
render() {
return (
<div className='Home'>
Hello world!
<Grid />
</div>
);

BIN
src/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB