а как здесь сделать фон?
хедеру задать картинку , и еще прозрачный фон вверху.
как лучше. чтоб именно к одному блоку прикреплять
1 ответ
* {
padding: 0;
margin: 0;
}
section {
min-height: 400px;
background: url('http://www.castellobevilacqua.com/image/Castello_dintorni/Natura/Background_natura/2Arte-e-natura.jpg') no-repeat center top;
background-size: cover;
position: relative;
}
section:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.75);
}
.container {
position: relative;
max-width: 500px;
margin: 0 auto;
padding: 25px 10px;
}
h2 {
color: #fff;
text-align: center;
font-size: 30px;
margin: 25px 0;
}
<section>
<div class="container">
<h2>text</h2>
</div>
</section>