selector { property: value; property: value; }
body { color: yellow; background-color: black; font: 10px sans-serif; }
#container { width: 70%; padding: 10px; margin: auto; border-bottom: 1px solid #ccc; }
Press → key to advance.
selector { property: value; property: value; }
body { color: yellow; background-color: black; font: 10px sans-serif; }
#container { width: 70%; padding: 10px; margin: auto; border-bottom: 1px solid #ccc; }
The World Wide Web Consortium (W3C) is an international community that develops open standards to ensure the long-term growth of the Web. This includes releases of HTML and CSS.
selector { property: value; -webkit-property: value; -moz-property: value; -ms-property: value; -o-property: value; }
div { transform: rotateX(-30deg); -webkit-transform: rotateX(-30deg); -moz-transform: rotateX(-30deg); -ms-transform: rotateX(-30deg); -o-transform: rotateX(-30deg); }
More reading on vendor prefixes / browser integration: MDN Vendor Prefix, shouldiprefix.com, caniuse.com
face: border-radius: 0px; left eye: border-radius: 0px; right eye: border-radius: 0px; base white: border-radius: 0px; mouth: border-radius: 0px; nose: border-radius: 0px; left black eye: border-radius: 0px; right black eye: border-radius: 0px;
color: rgba(255, 255, 255, 1); background: rgba(0, 0, 0, 0.5);
color: hsla( 128, 74%, 33%, 1.00
background-image: linear-gradient(to bottom, #f95a61 0%, #ffffff 50%, #2a4758 100%);
background-image: radial-gradient(center, circle cover, red, #000 40%);
More reading: MDN: linear-gradient
text-shadow: rgba(64, 64, 64, 0.5) 0px 0px 0px;
box-shadow: rgba(0, 0, 128, 0.25) 0px 0px 0px;
div {
-webkit-text-fill-color: black;
-webkit-text-stroke-color: turquoise;
-webkit-text-stroke-width: 0.00px;
text-align: left;
text-decoration: overline pink wavy;
text-transform: uppercase;
text-indent: 100px;
}
filter: contrast(80%); filter: blur(5px); filter: sepia(20%); filter: invert(0%); filter: opacity(50%);
filter: hue-rotate(60deg); filter: grayscale(10%); filter: brightness(120%); filter: drop-shadow(5px 5px black); filter: saturate(110%);
@font-face { font-family: 'LeagueGothicRegular'; src: url('fonts/leaguegothic/leaguegothic-webfont.eot'); } .special-header { font-family: 'LeagueGothicRegular', sans-serif; }
Finding fonts:
filter
to change how the image looks.See the Pen Submarine with CSS by Alberto Jerez (@ajerez) on CodePen.
Define a custom CSS3 animation (in this case, named "pulse") using CSS3 @keyframes:
@keyframes pulse { from { opacity: 0.0; font-size: 100%; } to { opacity: 1.0; font-size: 200%; } }
Apply the CSS animation you defined to a specific HTML element.
<div>Pulse!</div>
div { animation-name: pulse; animation-duration: 2s; animation-iteration-count: infinite; animation-timing-function: ease-in; animation-direction: alternate; }
@keyframes rainbow { 0% { background-color: red; width:500px; } 25% { background-color: yellow; width: 200px; } 50% { background-color: blue; width: 300px } 100% { background-color: green; width: 200px; } } div { animation-name: rainbow; animation-duration: 6s; animation-iteration-count: infinite; animation-timing-function: ease-in; animation-direction: alternate; }
#box.left { margin-left: 0; } #box.right { margin-left: 1000px; }
#box { transition: margin-left 1s ease-in-out; }
You can transform this div by hovering over it!
#transform-example { transform: rotateZ(5deg); transition: transform 2s ease-in-out; } #transform-example:hover { transform: rotateZ(-5deg); }
Other Transform Values
See the Pen Submarine with CSS by Alberto Jerez (@ajerez) on CodePen.