Created
April 13, 2013 16:48
-
-
Save sebdeckers/5379150 to your computer and use it in GitHub Desktop.
Example of CSS syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* universal selector */ | |
| * { | |
| color: rgb(50, 50, 50); | |
| } | |
| /* element name */ | |
| p { | |
| font-family: "Tahoma"; | |
| border-bottom: 2px solid blue; | |
| } | |
| /* class */ | |
| p.highlight { | |
| font-weight: bold; | |
| } | |
| /* multiple classes */ | |
| p.highlight.quotation { | |
| font-style: italic; | |
| } | |
| /* multiple selectors */ | |
| .author, | |
| .date { | |
| /* vendor prefix */ | |
| -webkit-transform: rotate(-90deg); | |
| } | |
| /* id */ | |
| #map { | |
| width: 300px; | |
| height: 180px; | |
| } | |
| /* attribute */ | |
| a[download] { | |
| border-left: 10px solid red; | |
| padding-left: 5px; | |
| } | |
| /* element name */ | |
| a { | |
| color: red; | |
| } | |
| /* pseudo class */ | |
| a:hover { | |
| color: white; | |
| bcakground-color: black; | |
| } | |
| /* pseudo element */ | |
| input[required]::after { | |
| background-image: url(attention.png) | |
| width: 20px; | |
| height: 20px; | |
| } | |
| /* combinators */ | |
| article > h1 + p { | |
| font-size: 150%; | |
| } | |
| img[title]::after { | |
| /* attribute reference */ | |
| content: attr(title); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment