Skip to content

Instantly share code, notes, and snippets.

@sebdeckers
Created April 13, 2013 16:48
Show Gist options
  • Save sebdeckers/5379150 to your computer and use it in GitHub Desktop.
Save sebdeckers/5379150 to your computer and use it in GitHub Desktop.
Example of CSS syntax
/* 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