Cool notification css style
Cool notification style using CSS3
HTML<div class="notify success"> <h1><span class="alerticon"><img alt="" src="success.png" /></span> Success!</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt erat volutpat.</p> </div> <div class="notify error"> <h1><span class="alerticon"><img alt="" src="error.png" /></span> Error!</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt erat volutpat.</p> </div> <div class="notify info"> <h1><span class="alerticon"><img alt="" src="info.png" /></span> Info!</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt erat volutpat.</p> </div> <div class="notify warning"> <h1><span class="alerticon"><img alt="" src="warning.png"/></span> Warning!</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt erat volutpat.</p> </div>CSS
body { background-color: #f0f0f0; font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; color: #313131; font-size: 62.5%; line-height: 1; padding:5px; } strong { font-weight: bold; } img { border: 0; max-width: 100%; vertical-align: middle; width:30px } /** H1 **/ h1 { font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 2.5em; line-height: 1.5em; margin: 0px; margin-bottom: 20px; padding: .1em 0; color: #444; position: relative; overflow: hidden; white-space: nowrap; } h1:before, h1:after { content:""; position: relative; display: inline-block; width: 50%; height: 1px; vertical-align: middle; background: #f0f0f0; } h1:before { left: -.5em; /*margin: 0 0 0 -50%;*/ } h1:after { left: .5em; /*margin: 0 -50% 0 0;*/ } h1 > span { display: inline-block; vertical-align: middle; white-space: normal; } p { display: block; font-size: 1.35em; line-height: 1.5em; margin-bottom: 10px; } /** notifications **/ .notify { display: block; background: #fff; padding: 12px 18px; max-width: 400px; margin: 0 auto; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; margin-bottom: 20px; box-shadow: rgba(0, 0, 0, 1.5) 1px 1px 2px 0.5px; } .notify h1 { margin-bottom: 6px; } .notify .alerticon { margin-bottom: 5px; } /* Success */ .success h1 { color: #678361; } .success h1:before, .success h1:after { background: #cad8a9; } .success:hover h1 { background-color: #fff; } .success:hover { color: #fff; background-color: #4cbe83; } /* Error */ .error h1 { color: #6f423b; } .error h1:before, .error h1:after { background: #d6b8b7; } .error:hover h1 { background-color: #fff; } .error:hover { color: #fff; background-color: #e47c68; } /* Warning */ .warning h1 { color: #eda93b; } .warning h1:before, .warning h1:after { background: #eda93b; } .warning:hover h1 { background-color: #fff; } .warning:hover { color: #fff; background-color: #eda93b; } /* Info */ .info h1 { color: #6cc8d4; } .info h1:before, .info h1:after { background: #6cc8d4; } .info:hover h1 { background-color: #fff; } .info:hover { color: #fff; background-color: #6cc8d4; }
Cool notification css style
Reviewed by Bhaumik Patel
on
6:01 PM
Rating: