Обрезать картинку в background:url

149
02 мая 2019, 00:20
body {
    background: url(./img/body_alt.jpg) top center no-repeat fixed;
    }

Изображение: 1920х1080px. Внутри <body> конечно же есть внутренние элементы. Как обрезать изображение до 290px высотой?

Answer 1

Если нужно сделать часть фона, то самый просто вариант - задать фон не body, а какому-то зафиксированному блоку высотой 290px:

.fon-wrap { 
  position: fixed; 
  top: 0; 
  width: 100%; 
  height: 290px; 
  background: url('https://avatanplus.com/files/resources/original/58ed2c368452515b5e74b50e.jpg') top center no-repeat fixed; 
} 
.content { 
  position: relative; 
  padding-top: 50px; 
  height: 1000px; 
} 
.content h1 { 
  color: white; 
  text-align: center; 
} 
.content p { 
  font-size: 20px; 
  width: 80%; 
  margin: 30px auto; 
}
<div class="fon-wrap"></div> 
<div class="content"> 
<h1>ЗАГОЛОВОК</h1> 
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> 
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> 
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p> 
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 
</div>

READ ALSO
Помогите отобразить правильно компонент в Angular WEB App

Помогите отобразить правильно компонент в Angular WEB App

Вот ссылка на последний комит: https://githubcom/AlelekovEvgeny/CarefulClinic/commit/e8620a7b8d4e191015ac2480b77843dba3a1bc95 Задача была следующая: из страницы list-prophylactic

149
Артефакты прорисовки теней в рамке с уголком

Артефакты прорисовки теней в рамке с уголком

Надо мне сверстать рамку с уголком подобного вида:

142