I am trying to build a simple card to display a button and a text.
I can't make the alignment proper. perhaps too much overload of css.
it looks like:
I just want the content centered vertically and horizontally with the text and the button below the text
here is the code:
import React from 'react';
import {Button} from 'react-bootstrap';
import './EmptyTile.css';
class EmptyTile extends React.Component {
render() {
return (
<div className="empty-tile">
<h1>{this.props.text}</h1>
<Button bsPrefix="button-empty-tile" href={this.props.url}>Start</Button>
</div>
);
}
}
export default EmptyTile;
and css
.empty-tile {
width: 240px;
height: 360px;
border-radius: 20px;
box-shadow: 0px 8px 18px 0 rgba(0,0,0,0.14);
align-items: center;
text-align: center;
justify-content: center ;
display: flex;
}
.empty-tile h1 {
font-family: Fredoka One;
font-size: 18px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: -0.44px;
text-align: center;
color: #cacaca;
padding-left: 15px;
padding-right: 15px;
}
.button-empty-tile {
border-radius: 21px;
background-color: #f4f7f8;
border-color: #cacaca;
font-family: Source Sans Pro;
font-size: 16px;
text-align: center;
color: #cacaca;
padding-top: 5px;
padding-bottom: 7px;
padding-left: 20px;
padding-right: 20px;
}
Any idea ? the code is very simple