Vertical align
by code4pi
HTML
<div id="flash" class="center active error">
<div class="flash-message">
Please enter an email. Please enter an email. Please enter an email. Please enter an email. Please enter an email. Please enter an email.
</div>
<div class="flash-close">x</div>
</div>
CSS
#flash {
display: flex;
justify-content: center;
position: absolute;
top: 4em;
left: 0;
right: 0;
width: 50%;
text-align: center;
z-index: 101;
line-height: 2.5;
overflow: hidden;
-webkit-box-shadow: 0 0 5px #000;
-moz-box-shadow: 0 0 5px #000;
box-shadow: 0 0 5px #000;
border-radius: 3px;
}
.flash-message {
display: inline-block;
width: 80%;
padding-left: 10%;
margin: 3px 0;
}
#flash.error { background: blue; }
#flash.notice { background: green; }
.flash-close {
align-self: center;
display: inline-block;
vertical-align: middle;
margin: 3px 11px 3px 0;
padding: 2px 6px;
font-family: Arial, sans-serif;
font-size: 1em;
font-weight: normal;
color: #fff;
line-height: 1;
border: 1px solid rgba(255,255,255,0.2);
}