Практика 1 - Блок по середине
by fersterin
HTML
<div class="dog">
<h1>Многое известно</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores totam sed doloribus.</p>
</div>
CSS
html {
background: linear-gradient(45deg, #E2BE8A, #EB7C47);
height: 100%;
vertical-align: middle;
position: relative;
}
div.dog {
width: 270px;
height: 200px;
box-sizing: border-box;
padding: 25px 40px 40px 40px;
background: #EFC756;
color: white;
margin: 0 auto;
position: absolute;
top: 50%;
left: 50%;
margin-left: -135px;
margin-top: -100px;
}
.dog h1 {
color: white;
font-size: 24px;
padding-top: 0px;
padding-left: 40px;
position: relative;
line-height: 0.8;
}
.dog h1:before {
content: '';
width: 32px;
height: 38px;
position: absolute;
left: 0;
top: 0;
background: url(http://6gus.tk/upload/dog77.jpg);
display: block;
}