Professional Documents
Culture Documents
A - External CSS
1 – Link tag
<head>
<link rel=’’stylesheet’’ href=’’css/styles.css’’>
</head>
2 – Import
In ccs file
@import url(‘/styles/layout.css’) ;
@import url(‘/styles/typography.css’) ;
@import url(‘/styles/buttons.css’) ;
Index.html
<head>
<style>
@import url(‘’css/styles.css’’) ;
</style>
</head>
Downside of using umport : Slowing down your page speed.
Import does not allow for parallel downloads meaning the page need to load the entire
stylesheed before it load the res of the page.
3 – Inline CSS
4 – Internal CSS
<head>
<style>
H1{
color:green;
}
H2{
color:blue;
}
</style>
</head>
Downside : multiple html document will need to copy the css into each file.
II – Approach
Before adding css. put your content , is better to have as much content as possible because it gives
you context.
III – Images
https://www.shopify.com/blog/7412852-10-must-know-image-optimization-tips
Retina Display
Absolute
Relative
Unitless Values
Class selector
ID selector
Grouping Selectors
Inheritance
All property are not inherited. Check W3C property list to check out which one does.
1. Universal (*)
2. type (p)
3. class (.example)
4. id (#example)
a:visited {
/* color: gray; */
}
a:focus {
outline: 1px solid black;
}
a:hover {
background: gray;
}
a:active {
/* color: white; */
}
HTML Elements
2 types of HTML elements: inline and block-level
Inline
Block
Border
Margin
Line return
Content Wrapper
Typography
5 categories of typefaces
Scripts
Hand lettered look, greeting cards, in web headlines or small decorative text details
Decorative
Monospace
Each character uses the same amount of horizontal space, often used for displaying code
Serif
Sans-serif
font-family
font-weight
- normal is equal to 44 and is also the default for body text*
- bold is equal to 700 and is the default for headings
@font-face
font-size
text-decoration
Flexbox and Grid
flex-
direction
flex-direction
flex-wrap
flex-grow
flex-shrink
flex-alignment
css grid
- When using the value of grid the items will span the width of its container.
- When using the value of inline-grid the items will span the width of its content.
Grid Lines
Grid Cell
Positioning grid-items
Advanced selectors
Descendant Selectors
Child combinator
Sibling Combinators
Adjacent Sibling combinators
Responsive
Images