Forum Moderators: not2easy
They've very powerful when used for a call to action like a newsletter subscription.
what has this to do with CSS?
The modals are styled using CSS.
"In the article linked from the demo,
you can see the code they used..."
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
border-radius: 0;
box-shadow: inset 0 0 2.5em #000;
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
#mask {
position: fixed;
z-index: 2;
top: 50%;
left: 50%;
right: 50%;
bottom: 50%;
border-width: 0;
border-radius: 50%;
box-shadow: inset 0 0 0 #000;
transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 1.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
border-radius: 0;
box-shadow: inset 0 0 2.5em #000;
transform: rotateZ(0deg);
}
#mask {
position: fixed;
z-index: 2;
top: 50%;
left: 50%;
right: 50%;
bottom: 50%;
border-width: 0;
border-radius: 50%;
box-shadow: inset 0 0 0 #000;
transform: rotateZ(360deg);
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 1.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
transform: rotateY(0deg) ;
}
#mask {
position: fixed;
z-index: 2;
top: 0;
left: 50%;
right: 50%;
bottom: 0;
border-width: 0;
box-shadow: inset 0 0 0 #000;
transform: rotateY(90deg);
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 1.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
transform: rotateX(0deg);
}
#mask {
position: fixed;
z-index: 2;
top: 50%;
left: 0;
right: 0;
bottom: 50%;
border-width: 0;
box-shadow: inset 0 0 0 #000;
transform: rotateX(90deg);
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 1.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
}
#mask {
position: fixed;
z-index: 2;
top: 0%;
left: 0;
right: 0;
bottom: 100%;
border-width: 0;
box-shadow: inset 0 0 0 #000;
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 1.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
}
#mask {
position: fixed;
z-index: 2;
top: 100%;
left: 0;
right: 0;
bottom: 0;
border-width: 0;
box-shadow: inset 0 0 0 #000;
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 1.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
opacity: 1;
}
#mask {
position: fixed;
z-index: 2;
top: 100%;
left: 100%;
right: 0;
bottom: 0;
border-width: 0;
box-shadow: inset 0 0 0 #000;
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
opacity: 0;
overflow: hidden;
transition: all 0.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
opacity: 1;
}
#mask {
position: fixed;
z-index: 2;
top: 100%;
left: 0;
right: 100%;;
bottom: 0;
border-width: 0;
box-shadow: inset 0 0 0 #000;
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
opacity: 0;
overflow: hidden;
transition: all 0.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
opacity: 1;
}
#mask {
position: fixed;
z-index: 2;
top: 0;
left: 0;
right: 100%;
bottom: 100%;
border-width: 0;
box-shadow: inset 0 0 0 #000;
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
opacity: 0;
overflow: hidden;
transition: all 0.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
box-shadow: inset 0 0 2.5em #000;
opacity: 1;
}
#mask {
position: fixed;
z-index: 2;
top: 0;
left: 100%;
right: 0;
bottom: 100%;
border-width: 0;
box-shadow: inset 0 0 0 #000;
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
opacity: 0;
overflow: hidden;
transition: all 0.5s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
I sense a cottage industry out there!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
opacity: 1;
box-shadow: inset 0 0 2.5em #000;
transform: rotateY(0deg);
}
#mask {
position: fixed;
z-index: 2;
top: 0%;
left: 50%;
right: 50%;
bottom: 0%;
border-width: 0;
opacity: 0;
box-shadow: inset 0 0 0 #000;
transform: rotateY(90deg);
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 0.75s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>CSS modal window</title>
<style media="screen">
body {
background: #f0f0f0;
font: 1em/1.62em verdana, arial, helvetica, sans-serif;
}
#r0, #r1 {
display: none;
}
#r0:checked~#mask {
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 0.625em solid #000;
opacity: 1;
box-shadow: inset 0 0 2.5em #000;
transform: rotateX(0deg);
}
#mask {
position: fixed;
z-index: 2;
top: 50%;
left: 0%;
right: 0%;
bottom: 50%;
border-width: 0;
opacity: 0;
box-shadow: inset 0 0 0 #000;
transform: rotateX(90deg);
background: linear-gradient(to bottom,rgba(0,0,0,0.5),rgba(0,0,0,0.9));
overflow: hidden;
transition: all 0.75s ease;
}
#box {
position: relative;
width: 20.5em;
padding: 0.25em 1.5em 1em;
border: 0.125em solid #000;
border-radius: 0.625em;
margin: 10% auto;
background-color: #fff;
background-image: linear-gradient(to bottom,#fff,#888);
}
#box h2 {
text-align: center;
}
#overlay {
display:block;
width: 10em;
line-height: 3em;
margin:auto;
border-radius: 0.75em;
font-weight: bold;
color: #fff;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 0.1em #030;
cursor: pointer;
background: linear-gradient(to bottom,rgba(0,127,0,0.3),rgba(0,127,0,0.7));
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close {
position: absolute;
top: -1em;
right: -0.875em;
padding: 0.25em 0.5em;
border-radius: 50%;
font-weight: bold;
color: #fff;
cursor: pointer;
background-color: #333;
box-shadow: 0.1em 0.1em 0.25em #000;
}
#close:hover {
background-color: #fc0000;
}
</style>
</head>
<body>
<input id="r0" name="r" type="radio">
<input id="r1" name="r" type="radio">
<label id="overlay" for="r0">open overlay</label>
<div id="mask">
<div id="box">
<label id="close" for="r1" title="Close" >X</label>
<h2>NOTICE:</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero
bibendum tempus faucibus quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor nibh,
posuere ac lorem ut, suscipit tincidunt leo. Duis interdum justo ac justo vehicula consequat.
</p>
<!-- end #box --></div>
<!-- end #mask --></div>
</body>
</html>