CSS Cheat Sheet
CSS Cheat Sheet
CSS Cheat Sheet
com / CSS
Basics
Selectors Syntax
selector{
* all elements property: value;
div all div tags property2: value2;
div,p all divs and paragraphs }
div p paragraphs inside divs
div > p all p tags, one level deep in div Include external css file
div + p p tags immediately after div <link rel="stylesheet" type="text/css" href="/style
div ~ p p tags preceded by div
.classname all elements with class
Internal styles
#idname element with ID
div.classname divs with certain classname <style type="text/css">
div#idname div with certain ID div { color: #444;}
#idname * all elements inside #idname </style>
Border Outline 0 0
Width: 2
Style:
solid dotted dashed double
Media Queries
groove ridge inset outset
Syntax
hidden none
@media not|only mediatype and (media feature) {
CSS Code }
Color: 1C6EA4 1 Link external file:
<link rel="stylesheet" media=mediatype and|not|only
Position:
All Top Right Bottom
Viewport is 480 pixels or smaller
Left @media screen and (max-width: 480px) { }
One line
Viewport width smaller OR height smaller
border: 2px solid #1C6EA4;
@media screen and (max-width: 600px), (max-height:
Print style
@media print { ... }
HTML Cheat Sheet is using cookies. | PDF | Terms and Conditions, Privacy Policy
© HTMLCheatSheet.com