Add grid item margins and sample text

columns
Tanner Collin 6 years ago
parent fcae4371e6
commit 1bc64552c0
  1. 4
      src/App.css
  2. 13
      src/Grid.css
  3. 28
      src/Grid.js
  4. 15
      src/GridItem.js
  5. 1
      src/Home.js
  6. BIN
      src/logo.png

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

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

@ -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>
);
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save