I have an app on reactjs, when i add margin to the text it adds margin to the div and main div shifts down. JSX Code:
import React, {Component} from 'react';
import './Travel.css';
class Travel extends Component {
render(){
return(
<div className='top'>
<div className='content'>
<span className='conth'>
<h1>A TRAVELS</h1>
<h1>YEARBOOK</h1>
</span>
</div>
</div>
);
}
}
export default Travel;
CSS Code:
@import url(//fonts.googleapis.com/css?family=Open+Sans:800);
.top{
height:789px;
width: 100%;
background-image: url('travel.jpg');
background-repeat: no-repeat;
background-size: cover;
z-index: -1;
}
.content h1{
margin-top: 10px;
}
.conth{
font-family: 'Open Sans';
font-size: 43px;
width: 500px;
color: #ffffff;
}
Please help me how to solve this problem.