<div role="dialog" aria-modal="true" aria-haspopup="true" tabindex="-1" aria-live="assertive" aria-describedby="dialog-description" class="modal-dialog no--bg dialog" id="openModal">
<div class="modal">
<a href="#close" title="Close" tabindex="1" role="button" accesskey="x" class="close no__select" id="close-modal" onclick="document.getElementById('openModal').style.display='none';return true;"><strong>×</strong></a>
<div class="header-modal no__select">
<h3 id="dialog-description">Parameters</h3>
</div>
<div class="inner-dialog">
<h4>Modal Box</h4>
<img src="https://raw.githubusercontent.com/cara-tm/modal_box/master/ie-6.png" alt="IE6 preview" />
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
</div> <!-- /inner-dialog -->
<div class="footer-modal link--ltr no__select">
<a href="https://www.cara-tm.com" target="_blank" role="button" class="">Help</a><a href="#close" role="button" accesskey="x" class="" id="footer-close" onclick="document.getElementById('openModal').style.display='none';return true;">Close</a>
</div>
</div> <!-- /modal -->
</div> <!-- /modal-dialog -->
<div role="dialog" aria-modal="true" aria-hidden="true" aria-haspopup="true" aria-describedby="message-description" tabindex="-1" class="modal-dialog dialog" id="openModal2">
<div class="modal modal-message">
<a href="#close" title="Close" tabindex="1" role="button" accesskey="x" class="close no__select" id="close-msg" onclick="document.getElementById('openModal2').style.display='none';return true;"><strong>×</strong></a>
<div class="inner-dialog modal-message">
<h3 id="message-description">Message Box</h3>
<p>
<!--
<span class="info-sign"><strong>ℹ</strong></span>
<span class="warning-sign"><strong>⚠</strong></span>
-->
<span class="success-sign"><strong>✔</strong></span>
<!--
<span class="error-sign"><strong>✕</strong></span>
-->
This is a sample modal message box suitable for infos. ✌
<img src="http://i.dailymail.co.uk/i/pix/2017/06/05/23/4122CB5800000578-4575188-image-a-75_1496702169628.jpg" alt="Funny!" class="thumb" />
</p>
</div> <!-- /inner-dialog -->
</div> <!-- /modal -->
</div> <!-- /modal-dialog -->
<div role="main" class="wrapper">
<p class="first-line">
<a href="#open" tabindex="3" accesskey="3" class="button">A simple link</a>
<a href="#openModal" tabindex="1" accesskey="1" class="button" id="link1" onclick="document.getElementById('openModal').style.display='block';return true;">Open Modal Box</a>
<a href="#openModal2" tabindex="2" accesskey="2" class="button" id="link2" onclick="document.getElementById('openModal2').style.display='block';return true;">Open Modal Message</a>
</p>
<p>CSS Modal Boxes with a pretty good browsers support: IE6 minimim! ✌ <br /> (Latest version with “Flexbox” & “CSS Grid Layout” tests inside but without any noticed benefits 💣).</p>
<p>Responsive, with a convenient vertical adaptation within small screens.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
</div> <!-- /wrapper -->
@charset "UTF-8";
/*! CSS Modal Box by cara-tm.com - https://github.com/cara-tm/modal_box - MIT license
@author: Patrick LEFEVRE
@date: May 2017
@revision: 26th June 2018
*/
html {
font-size: 62.5%;
font-size: calc(1em * .625);
text-size-adjust: 100%;
text-size-adjust: 100%;
osx-font-smoothing: grayscale;
font-smoothing: antialiased;
text-rendering: optimizeLegibility
}
/**
* Min resets
*/
html,
body {
height: 100%;
margin: 0;
padding: 0
}
/**
* Prevent conflicts from other CSS rules
*/
body .modal-dialog {
font: normal normal normal 16px/1 Arial, 'Helvetica Neue', Helvetica, sans-serif;
font-kerning: normal;
font-feature-settings: "kern";
font-feature-settings: "kern";
font-feature-settings: "kern"
}
/**
* Desable the user's mouse selection
*/
.no__select {
user-select: none;
user-select: none;
user-select: none;
user-select: none
}
/**
* Animation
*/
@-webkit-keyframes scale-up-center {
0% {
transform: scale(.5);
transform: scale(.5)
}
100% {
transform: scale(1);
transform: scale(1)
}
}
@keyframes scale-up-center {
0% {
transform: scale(.5);
transform: scale(.5)
}
100% {
transform: scale(1);
transform: scale(1)
}
}
/**
* Open the modal box
*/
.modal-dialog:target {
opacity: 1;
display: block;
/* Background height, here is the math:
5vh × 2 + the bluring shadow's height (70px).
Better place into @media query.
Keeping here for CodePen demo */
height: calc(100vh + 10vh + 70px);
pointer-events: auto
}
/* Prevent outline on opening modals within some browsers */
.modal-dialog:target {outline: none}
/**
* Apply animation on modal box opening
*/
.modal-dialog:target .modal {
opacity: 1;
animation: scale-up-center 100ms cubic-bezier(.39, .575, .565, 1) both;
animation: scale-up-center 100ms cubic-bezier(.39, .575, .565, 1) both
}
/**
* Hide the background beside the modal box
*/
html .modal-dialog:target ~ .wrapper,
a[class^="close"]:target ~ .wrapper {
overflow: auto;
position: absolute;
z-index: -1;
top: 0;
left: 0;
height: 1px;
margin: 0;
padding: 0
}
/**
* For default browser (Android 2.3.6): restores the
* wrapper visibility after closing the modal box
*/
#close:target ~ .wrapper,
a[class^="close"]:target ~ .wrapper {position: static}
/**
* The wrapper of the modal box
*/
.modal-dialog {
display: none;
opacity: 0;
position: absolute;
z-index: 99999;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 0
}
/**
* Old browsers can't inherit the document's height:
* keep it for modern ones
*/
@supports (display: flex) {
html .modal-dialog:target ~ .wrapper {
/* Render the wrapper document fixed within modern browsers and with a 0px height within old ones */
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100vh
}
html .modal-dialog:target ~ .wrapper .first-line{padding-top: 30px}
.modal-dialog {
height: auto;
background: #fff url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNiqAcAAIgAgoGu+rEAAAAASUVORK5CYII=') 0 0 repeat;
background: rgba(255, 255, 255, .90)
}
}
/*!
* A class for the modal-dialog to hide the background beside the modal boxes */
html .modal-dialog.no--bg:target ~ .wrapper {height:0}
/**
* The inner part of the modal box
*/
.modal-dialog .modal {
overflow: hidden;
/* For old FF versions */
overflow: hidden-unscrollable;
position: relative;
z-index: 1000;
width: 98%;
max-width: 36em;
min-width: 250px;
margin: 1.5% auto;
margin: 5vh auto;
background: #fff;
font-size: 125%;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
box-shadow: 0 0 10px rgba(0, 0, 0, .3);
box-shadow: 0 0 30px rgba(0, 0, 0, .3);
box-shadow: 0 0 10px rgba(0, 0, 0, .3);
box-shadow: 0 0 10px rgba(0, 0, 0, .3);
box-shadow: 0 0 10px rgba(0, 0, 0, .3);
box-shadow: 0 0 10px rgba(0, 0, 0, .3);
/* Activates GPU Hardware-Acceleration */
will-change: transform;
/* For IE7- support: can be safely removed if not used */
*zoom: 1
}
/* Flexbox test support: not really needed */
@supports (display: flex) {
.modal-dialog .modal {
display: flex;
box-pack: justify;
justify-content: space-between;
flex-pack: justify;
justify-content: space-between;
flex-wrap: wrap;
flex-wrap: wrap;
flex-wrap: wrap;
box-flex: 0;
flex: 0 0 100%;
flex: 0 0 100%;
flex: 0 0 100%
}
}
/* Grid test support: not really needed */
@supports (display: grid) {
.modal-dialog .modal {
display: grid;
grid-column: auto / span 1;
/*
grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
*/
box-pack: initial;
box-flex: unset;
flex-wrap: initial;
flex: unset;
justify-content: initial
}
}
/**
* The close button
*/
.modal-dialog .close {
box-sizing: content-box;
display: block;
position: absolute;
z-index: 10000;
top: .35em;
right: .9em;
width: 1.5em;
height: 1.5em;
margin: 0;
padding: 0;
vertical-align: middle;
align-self: center;
text-align: center;
text-decoration: none;
color: #fff;
/* No vendor prefix for FF: ugly in old versions */
border-radius: 50%;
border-radius: 50%;
border-radius: 50%
}
.modal-dialog .close strong {
display: block;
width: 1.5em;
height: 1.5em;
margin: 0;
padding: 0;
vertical-align: middle;
line-height: 1.5em;
font-weight: normal;
cursor: pointer
}
/**
* The close button state
*/
.modal-dialog .close:hover,
.inner-dialog .close:active {
outline: none;
border: none;
transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
tap-highlight-color: transparent
}
/**
* The header of the modal box
*/
.modal-dialog .header-modal {
position: relative;
z-index: 1001;
display: block;
width: 100%;
height: 5em;
min-height: 5rem;
max-height: 26vh;
border: 1px solid #eee;
border-bottom: 0;
color: #aaa;
font-family: 'Noto Sans', sans-serif;
font-weight: 300;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=30,Direction=95,Color='#ffffff')";
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=30, Direction=95, Color='#ffffff');
box-shadow: -15px 10px 30px rgba(255, 255, 255, .9);
box-shadow: -15px 10px 30px rgba(255, 255, 255, .9);
box-shadow: -15px 10px 30px rgba(255, 255, 255, .9)
}
.modal-dialog .close {background: #03a9f4}
/**
* The main title of the modal box header
*/
.header-modal h3 {
display: inline;
display: inline-block;
margin: 0;
padding: .8em 3em 0 1em;
vertical-align: middle;
letter-spacing: -1px;
text-transform: capitalize;
line-height: 1;
font-size: 110%;
font-weight: 400
}
/**
* The content part into the modal box
*/
.modal-dialog .inner-dialog {
overflow: hidden;
/* For FF 1 */
overflow: auto;
overflow-y: visible;
overflow-y: auto;
display: block;
/* Necessary: some browsers (e.g. IE9) can't set the with of the block */
width: auto;
/* List of gracefull degradation max height */
max-height: 14em;
max-height: 47vh;
height: 99%;
margin: 0;
padding: 5px 15px 50px 20px;
/* For ss-content custom scroll bar script */
padding: 5px 15px 0 20px;
border-right: 1px solid #eee;
border-left: 1px solid #eee;
color: #212121;
scroll-behavior: smooth
}
.modal-dialog .modal,
.modal-dialog .modal.modal-message {
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0
}
/* Consistency visual borders for Message Boxes winthin old browsers */
.modal-dialog .modal.modal-message {border: 1px solid #eee}
.modal-dialog .modal.modal-message .inner-dialog {
width: 90%;
height: 100%;
max-height: none;
padding: 5px 10% 5px 20px;
border: none
}
.modal-dialog .inner-dialog img {
width: 100%;
interpolation-mode: bicubic;
}
/**
* Prevent headings resizing
*/
:any(.inner-dialog) * {font-size: 100%}
:any(.inner-dialog) * {font-size: 100%}
:matches(.inner-dialog) * {font-size: 100%}
/**
* Restores the paragraph font size
*/
.modal-dialog .inner-dialog p {
font-size: 85%;
line-height: 1.5;
hyphens: auto
}
:any(.modal-dialog) p {font-size: 85%}
:any(.modal-dialog) p {font-size: 85%}
:matches(.inner-dialog) p {font-size: 85%}
/**
* Styling the signs for the Modal Message Box
*/
span[class$="-sign"] {
display: inline-table;
display: inline-block;
/* 2px less due to padding */
width: 24px;
height: 28px;
margin: 0 2.5px;
padding: 0 2px;
vertical-align: middle;
text-align: center;
color: #fff;
font: normal normal normal 22px/28px Arial, sans-serif
}
span[class$="-sign"] strong {
display: inline-box;
display: inline-block
}
/**
* here is the error sign color
*/
.error-sign {background: #d32f2f}
/**
* Here is the info sign color
*/
html .info-sign {background: #3f51b5}
/**
* Here is the success sign color
*/
.success-sign {background: #00c853}
/**
* Here is the warning sign color
*/
.warning-sign {background: #fbc02d}
/**
* The footer of the modal box
*/
/*!
Note: the over state on footer links is very tiny within IE6 (limited to the text line height). If you want an exact rendering for this browser (and all others), inverse the order of you links (into the markup) then change the rules as this:
.footer-modal {
display: table;
(...)
}
.footer-modal a {
display: table-cell;
float: left;
(...)
}
*/
.footer-modal {
overflow: hidden;
/* Needed for some old browsers */
display: table;
width: 100%;
/* No height here, please: we need some kind of magic!
height: 3.426em;
height: 3rem;
*/
margin: 0;
padding: 0;
background: #0288d1;
vertical-align: middle;
text-align: right;
border: none;
border-right: 1px solid #0288d1;
border-left: 1px solid #0288d1;
border-radius: 0 0 2px 2px;
border-radius: 0 0 2px 2px;
border-radius: 0 0 2px 2px;
border-radius: 0 0 2px 2px;
border-radius: 0 0 2px 2px;
box-shadow: 0 -10px 30px rgba(0,0,0,.1);
box-shadow: 0 -10px 30px rgba(0,0,0,.1);
box-shadow: 0 -10px 30px rgba(0,0,0,.1);
box-shadow: 0 -10px 30px rgba(0,0,0,.1)
}
/**
* The footer links: no spaces between each!
*/
.footer-modal a {
display: inline-table;
/* Needed for links visibility in some browsers */
position: relative;
z-index: auto;
height: 3.56em;
height: 5rem;
padding: 0 2em;
border: none;
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
word-break: keep-all;
color: #fff;
font-weight: 700;
font-size: 70%;
line-height: 3.56em;
line-height: 5rem;
outline: none;
transition: .3s ease-out;
transition: .3s ease-out;
transition: .3s ease-out;
transition: .3s ease-out;
transition: .3s ease-out
}
/**
* Media query for screen below 720px
*/
@media only screen and (max-width:720px) {
.modal-dialog:target {
/* Background height, here is the math:
5vh × 2 + the bluring shadow's height (70px) */
height: calc(100vh + 10vh + 70px)
}
.modal-dialog .modal {width: 80%}
.header-modal {max-height: 11vmax}
.header-modal h1 {
font-size: 80%;
line-height: 1
}
html .header-modal span {
width: auto;
margin: 0
}
.header-modal a {
float: none;
width: 24px;
height: 24px;
margin: 0 0 0 .5em;
vertical-align: middle
}
.header-modal svg {
width: 22px;
height: 22px;
vertical-align: baseline
}
.modal-dialog .modal {
margin: 5vh auto;
margin: calc(15vh - 40px) auto;
margin: 5vmin auto
}
.footer-modal a {font-size: 60%}
.mob-hide {display: none}
}
/**
* Corrections for Opera 7.5 browser
* 1.° default height of the modal box
* 2.° fallback for line-height
*/
:prefocus,
html .modal-dialog .inner-dialog {
/* 1.° */
height: 100%;
max-height: 100%
}
html .visible .modal {transform: none;transform: none}
:prefocus,
html .footer-modal a {
/* 2.° */
display: inline-block;
padding: .8em 2em
}
/**
* The footer links states
*/
.footer-modal a:hover,
.footer-modal a:active {
background: #03a9f4;
tap-highlight-color: #03a9f4
}
/*! link--ltr: A class for the footer-modal bloc
in order to support ltr languages */
html .modal .link--ltr {
text-align: left
}
/* Language direction: works only with modern browsers */
[dir=rtl] .modal-dialog .footer-modal a {float: inline-end}
/**
* Styling the scroll bars for webkit browsers engine
*/
.modal-dialog ::scrollbar {
width: 3px;
height: 3px
}
.modal-dialog ::scrollbar-button {background-color: #666}
.modal-dialog ::scrollbar-track {background-color: #999}
.modal-dialog ::scrollbar-track-piece {background-color: #fff}
.modal-dialog ::scrollbar-thumb {
height: 50px;
background-color: #999;
border-radius: 3px
}
.modal-dialog ::scrollbar-corner {background-color: #999}
.modal-dialog ::resizer {background-color: #666}
/*! ============================
CSS rules for this page demo
*/
.wrapper {width: 100%}
.wrapper p {
width: 96%;
padding: 10px 2% 0;
font-size: 20px;
line-height: 1.5
}
p.first-line {float: left;clear: both;width: 96%}
/* Custom fonts */
.modal-dialog .inner-dialog h2{font-family: 'Noto Sans', sans-serif}
.modal-dialog .inner-dialog p{font-family: 'Open Sans', sans-serif}
/**
* The buttons
*/
.button {
float: left;
margin: 0 .5em 1em 0;
padding: .8em .5em 1em;
background: #0b7cd7;
color: #fff;
text-decoration: none;
font-size: 18px;
line-height: 1.2
}
.button:hover {text-decoration: underline}
/* Thumbnail :D */
.modal-dialog .inner-dialog .thumb {
clear: both;
display: block;
width: 80px;
height: 80px;
margin: .1em auto 0;
border: 6px solid #eee;
border-radius: 50%;
object-fit: cover;
object-fit: cover
}
/*! Add your js script here as an alternative to the :target event for all browser support prior IE9 (no more needed). More details here: https://github.com/cara-tm/modal_box
Please, resize the window. See how the boxes keep entirely visible into the viewport area never mind the View choosen on this CodePen editor.
Here is a live demo for your browserstack testing: http://sandbox.cara-tm.com/clients/cara/demo.html
*/
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.