I
I
IsaevDev2015-11-03 01:53:16
css
IsaevDev, 2015-11-03 01:53:16

Does this trick work in all browsers?

I don't know if this is a gimmick, but still.
We make a popup-window on the site with a dark background. Scroll inside the background.
Background:

display: none;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  -webkit-box-sizing:border-box;
  -moz-box-sizing:border-box;
  box-sizing:border-box;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow-x: hidden !important; 
  overflow-y: auto !important; 
  background-image: пиксель пнг;

That is, through left = top = right = bottom = 0 we stretch to the entire window without JS.
Besides ie6, will this work fine in other browsers, including mobile ones? (I tried it - it seems to work. But suddenly you advise against doing this)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Wolf, 2015-11-03
@IsaevDev

Yes, this is normal practice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question