Jump to content
  • 0

Схлопывание отступов и оверлей


Okieazy
 Share

Question

Столкнулся с проблемой схлопывания отступов при уменьшении высоты браузерного окна. Пофиксил, добавив overflow: auto; родительскому элементу. Однако, на оверлей это не действует. Как исправить?
Screenshot_1.thumb.png.dd796c1b1fb2078422a9e64bc35b7e9f.png
 

<header class="header overlay">		
	<div class="header-content">
		<h1 class="header-content__title">We are awesome creative agency</h1>
		<p class="header-content__descr">This is Photoshop's version  of Lorem Ipsum. Proin gravida nibh vel velit auctor aliquet. Aenean sollicitudin, lorem 			quis bibendum auctor, nisi elit consequat ipsum, nec sagittis sem nibh id elit. Duis sed odio sit amet nibh vulputate cursus a sit amet mauris. Morbi accumsan ipsum velit.</p>
	</div>
</header>

 

.overlay:before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	height: 100%;
	width: 100%;
	background-image: -webkit-linear-gradient(0deg, rgba(9, 5, 47, 0.851) 0%, rgba(49, 29, 94, 0.851) 100%);
	background-image: -ms-linear-gradient(0deg, rgba(9, 5, 47, 0.851) 0%, rgba(49, 29, 94, 0.851) 0%);
	z-index: -1;
}

.header {
	position: relative;
	max-height: 670px;
	height: 100vh;
	background-image: url('../images/header-bg.jpg');
	background-position: top center;
	background-size: cover;
	z-index: 1;
	overflow: auto;
}

.header-content {
	max-width: 700px;
	margin: 0 auto;
	margin-top: 150px;
	text-align: center;
	padding: 0 15px;
}

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy