You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
740 B
Markdown
34 lines
740 B
Markdown
6 years ago
|
# CSS / SCSS Udemy course
|
||
|
|
||
|
##General Advice
|
||
|
|
||
|
- set the boxsizing property on the _, _::after, and \*::before. Then use the body tag to flow inheritance down to all elements.
|
||
|
|
||
|
```scss
|
||
|
*,
|
||
|
*::before,
|
||
|
*::after {
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
box-sizing: inherit;
|
||
|
}
|
||
|
|
||
|
body {
|
||
|
font-family: Arial, Helvetica, sans-serif;
|
||
|
font-size: 1.6rem;
|
||
|
color: #777;
|
||
|
padding: 3rem;
|
||
|
line-height: 1.7;
|
||
|
box-sizing: border-box;
|
||
|
}
|
||
|
```
|
||
|
|
||
|
- Use rem units where ever you would use a px unit. Set the rem on html as a percentage to allow user styles to override yours, but keep the default a multiple of 10. Since most browsers are 16px default for rem 10/16 = 62.25%.
|
||
|
|
||
|
```scss
|
||
|
html {
|
||
|
// Set's the rem to 10px in most browsers (16px)
|
||
|
font-size: 62.5%;
|
||
|
}
|
||
|
```
|