Latest 100 public
snipts » css3
showing 1-20 of 25 snipts for css3
-
∞ All browsers that support the CSS text-shadow and box-shadow properties also support the new CSS3 RGBa syntax. Which means you can safely combine them today.
p { text-shadow: rgba(0, 0, 0, 0.2) 0 1px 0; }
-
∞ Zurb CSS3 Awesome Buttons
.awesome, .awesome:visited { background: #222 url(http://zurb.com/images/alert-overlay.png) repeat-x; border: 0px; border-bottom: 1px solid rgba(0,0,0,0.25); color: #fff; cursor: pointer; display: inline-block; font-family: 'Helvetica Neue', Arial, Helvetica, Verdana, sans-serif; -moz-border-radius: 5px; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5); padding: 5px 10px 6px; position: relative; text-decoration: none; text-shadow: 0 -1px 1px rgba(0,0,0,0.25); -webkit-border-radius: 5px; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5); } .awesome:hover { background-color: #111; color: #fff; } .awesome:active { top: 1px; } .small.awesome, .small.awesome:visited { font-size: 11px; } .awesome, .awesome:visited, .medium.awesome, .medium.awesome:visited { font-size: 13px; font-weight: bold; line-height: 1; text-shadow: 0 -1px 1px rgba(0,0,0,0.25); } .large.awesome, .large.awesome:visited { font-size: 14px; padding: 8px 14px 9px; } .green.awesome, .green.awesome:visited { background-color: #91bd09; } .green.awesome:hover { background-color: #749a02; } .blue.awesome, .blue.awesome:visited { background-color: #2daebf; } .blue.awesome:hover { background-color: #007d9a; } .red.awesome, .red.awesome:visited { background-color: #e33100; } .red.awesome:hover { background-color: #872300; } .magenta.awesome, .magenta.awesome:visited { background-color: #a9014b; } .magenta.awesome:hover { background-color: #630030; } .orange.awesome, .orange.awesome:visited { background-color: #ff5c00; } .orange.awesome:hover { background-color: #d45500; } .yellow.awesome, .yellow.awesome:visited { background-color: #ffb515; } .yellow.awesome:hover { background-color: #fc9200; } /* Sizes: small, medium, large Colors: Green, Blue, Red, Magenta, Orange, Yellow Sample: <button class="large awesome blue" type="submit">Awesome Blue Button</button> */
-
∞ CSS - CSS3 borde redondeado con border-radius cross browser
.round_top { -webkit-border-top-left-radius: 45px; -moz-border-radius-topleft: 45px; border-top-left-radius: 45px; -webkit-border-top-right-radius: 45px; -moz-border-radius-topright: 45px; border-top-right-radius: 45px; } .round_bottom { -webkit-border-bottom-left-radius: 45px; -moz-border-radius-bottomleft: 45px; border-bottom-left-radius: 45px; -webkit-border-bottom-right-radius: 45px; -moz-border-radius-bottomright: 45px; border-bottom-right-radius: 45px; }
-
∞ CSS - CSS3 rgba color transparency
/* Color RGB y debajo la transparencia, mientras mas pequeño mas transparente */ div { background: rgb(200, 54, 54); /* The Fallback */ background: rgba(200, 54, 54, 0.5); }
-
∞ viewport
<meta name="viewport" content="width=device-width" />
-
∞ single column
.article #aside { float: none; width: auto; } -
∞ shrink header part
body { background-image: url(/img/small-bg.png); } #wrapper { width: auto; margin: auto; text-align: left; background-image: url(/img/small-logo.png); background-position: left 5px; background-repeat: no-repeat; min-height: 400px; } -
∞ media queries
<link rel="stylesheet" type="text/css" media="only screen and (max-width: 480px), only screen and (max-device-width: 480px)" href="/assets/css/small-device.css" />
-
∞ CSS 3 background transparency with rgba colors
background: rgba(255, 0, 0, 0.2); /* red background with 20% of opacity, near to 0 is more opaque, near to 1 is more "colored" */
-
∞ kerning type css
/* kerning and readability improvement in Safari and Chrome */ html { text-rendering: optimizeLegibility; }
-
∞ smooth operator
/****SMOOTH OPERATOR********/ /* Make fonts appear smoother in Safari & Chrome */ html { -webkit-font-smoothing: antialiased; }
-
∞ CSS3 calc()
/* * HTML5 article + sidebar layout, split up by a 1em margin */ article { width: 60%; margin-right: 1em; } aside { width: calc(40% - 1em); }
-
∞ Linear Gradient
-webkit-gradient( linear, left top, left bottom, color-stop(0, rgb(255,255,255)), color-stop(1, rgb(255,0,0)) ) -moz-linear-gradient( center top, rgb(255,255,255) 0%, rgb(255,0,0) 100% )
-
∞ Rounded Corners
-webkit-border-radius:10px; -moz-border-radius:10px; border-radius:10px;
-
∞ Rounded Corners (Different Radiuses)
-webkit-border-top-left-radius:10px; -webkit-border-top-right-radius:10px; -webkit-border-bottom-right-radius:10px; -webkit-border-bottom-left-radius:10px; -moz-border-radius-topleft:10px; -moz-border-radius-topright:10px; -moz-border-radius-bottomright:10px; -moz-border-radius-bottomleft:10px; border-top-left-radius:10px; border-top-right-radius:10px; border-bottom-right-radius:10px; border-bottom-left-radius:10px;
-
∞ CSS3 Gradient
/* start color: #ffffff end color: #000000 top -> bottom */ background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#000000)); background: -moz-linear-gradient(center bottom, #000000, #ffffff 50%); background: -gradient(linear, left top, left bottom, from(#ffffff), to(#000000));
-
∞ CSS 3 structural pseudo-classes
CSS 3 structural pseudo-classes__--_-_-_-_-___-_-____ :nth-child______________________ ul li:nth-child(3) { color: red; } ul li:nth-child(3n+4) { color: yellow; } ul li:nth-child(3n) { color: yellow; } ul li:nth-child(-n+4) { color: green; } ul li:nth-child(-n+4) { color: green; } ul li:nth-last-child(odd) { color: grey; } ul li:nth-last-child(even) { color: grey; } :nth-of-type_____________________ p:nth-of-type(even) { color: blue; } :nth-last-of-type__________________ ul li:nth-last-of-type(-n+4) { color: green; } .post img:nth-of-type(n+2):nth-last-of-type(n+2) { float: left; } :last-child_______________________ .post > p:last-child { margin-bottom: 0; } :first-of-type and :last-of-type________ .post > p:first-of-type:first-line { font-variant: small-caps; } :only-child_______________________ div.news > p { font-size: 1.2em; } div.news > p:only-child { font-size: 1.5em; } :only-of-type_____________________ .post > img { float: left; } .post > img:only-of-type { float: none; margin: auto; } :empty__________________________ #sidebar .box:empty { display: none; } The negation pseudo-class:::::::::::::::::: input:not([type="submit"]) { width: 200px; padding: 3px; border: 1px solid #000000; } .post p:not(.date) { font-size: 13px; }
-
∞ Issue with vertical-align. temporarily using propietary browser elements.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> #wrapper { display:inline; vertical-align:middle; width:100%; height:100%; } #container { margin:auto; height:465px; width:960px; -moz-box-shadow:0 1px 10px #777; -moz-border-radius:10px; } </style> </head> <body> <div id="wrapper"> <div id="container"> </div> </div> </body> </html>
-
∞ Rounded Corners
/* All corners */ -moz-border-radius -webkit-border-radius /* Topleft */ -moz-border-radius-topleft -webkit-border-top-left-radius /* Topright */ -moz-border-radius-topright -webkit-border-top-right-radius /* Bottomleft */ -moz-border-radius-bottomleft -webkit-border-bottom-left-radius /* Bottomright */ -moz-border-radius-bottomright -webkit-border-bottom-right-radius
-
∞ border radius sides
border-radius-top-right: 10px; border-radius-bottom-right: 10px; -moz-border-radius-bottomright: 10px; -moz-border-radius-topright: 10px; -webkit-border-bottom-right-radius: 10px; -webkit-border-top-right-radius: 10px;


