What is CSS ?
- Cascading Style Sheets (CSS)
- A style sheet language used for specifying the presentation and styling of a document written in a markup language such as HTML or XML
- Describes how html elements are displayed on screen
- Can control multiple web pages at once
- External style sheets are stored in CSS files
Example :
body {
background-color: lightblue;
}
h1 {
color: white;
text-align: center;
}
p {
font-family: verdana;
font-size: 20px;
}
NOTE
- Typeface plays an important role in the accessibility of a page. Some fonts are easier to read than others, and this is especially true on low-resolution screens.
- While
ul/lielements are great at providing bullets for list items, your radio buttons don’t need them. You can control what the bullets look with thelist-styleproperty. For example you can turn your bullets into circles with the following:
ul {
list-style: circle;
}
- The
calc()function is a CSS function that allows you to calculate a value based on other values. For example, you can use it to calculate the width of the viewport minus the margin of an element:
.example {
margin: 10px;
width: calc(100%
- 20px);
}
- The
[attribute="value"]selector targets any element that has an attribute with a specific value. - The
transformproperty allows you to modify the shape, position, and size of an element without changing the layout or affecting the surrounding elements. It has functions such astranslate(),rotate(),scale(),skew(), andmatrix()
[!CHEAT SHEET] CSS cheat sheet