M
M
Maloy1232016-11-11 07:38:06
css
Maloy123, 2016-11-11 07:38:06

How to permanently indent a fixed block?

Hello! The question arose: how can you make permanent indents from the top and bottom of a fixed block when scrolling? Only a "crutch" with transparent borders came to mind, but in such cases, the scroll bar also has indents, but they should not be.
Here's the output so far codepen.io/anon/pen/gLPoqw
Thanks in advance for your help!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
iBird Rose, 2016-11-11
@iiiBird

move the scroll to the block itself codepen.io/anon/pen/rWxJZN

L
Lynn "Coffee Man", 2016-11-11
@Lynn

You need indents from .window, and set it to

.container {
  background: rgba(0, 0, 0, 0.8);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
}

.window {
  background: #ffffff;
  width: 900px;
  padding: 10px;
  margin: 20px auto;
}

A
Ankhena, 2016-11-11
@Ankhena

Example:
codepen.io/anon/pen/vyLjjE
Also, here it is

margin: 20px auto;
top: 0;
bottom: 0;

can be replaced with
margin: 0 auto;
top: 20px;
bottom: 20px;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question