I need to center a heading h1
inside of a div
with .box
class when the browser window width is less than 768 px.
.box {
float: left;
margin: 250px 0 0 0;
height: 35%;
width: 50%;
background-image: url('img/header-bcg.png');
}
.box h1 {
font-size: 40px;
font-family: Bree serif;
color: 33adae;
margin-top: 30px;
margin-right: 15px;
line-height: 10px;
float: right;
}
@media screen and (max-width: 768px) {
.section1 {
width: 100%;
}
.box {
width: 100%;
}
.box h1 {
text-align: center;
margin: 0 auto;
}
footer,
nav {
width: 100%;
}
}
<div class="box">
<h1><p>Moderní webdesign</p> za nejnižší ceny!</h1>
</div>