Last Updated: February 25, 2016
·
1.23K
· patrikengborg

Overlay behind modal window in one line of CSS

outline: 9999px solid rgba(0,0,0,.3);

Nice.

via @LeaVerou

3 Responses
Add your response

Does this work if your modal has rounded corners?

over 1 year ago ·

Mm, not sure. But after googling it, border-radius and outline doesn't seem to play very well together. So maybe you have to stick to a square box.

over 1 year ago ·

I'm not able to test right now, but a box-shadow with a large spread shoild accomplish the same trick without border-radius issues. YMMV per browser, of course.

over 1 year ago ·