CSS CheatSheet

CSS declarations

/* 
CSS declaration format:
property-name: value;
*/

/* CSS declarations */
text-align: center;
color: purple;
width: 100px;

CSS Rule Sets

h1 {
color: blue;
text-align: center;
}

Font Family

h2 {
font-family: Verdana;
}

#page-title {
font-family: "Courier New";
}

Font Size

font-size: 30px;

Font Weight

font-weight: bold;

Text Align

text-align: right;

Setting foreground text color in CSS

p {
color : #2a2aff ;
}

span {
color : green ;
}

Color Name Keywords

h1 {
color: aqua;
}

li {
color: khaki;
}

Background Color

background-color: blue;

Opacity

opacity: 0.5;

Background Image

background-image: url("nyan-cat.gif");

Resource URLs

background-image: url("../resources/image.png");

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store