William Liu

HTML, CSS


##Summary

##CSS

A good tool to learn CSS is Flexbox Froggy. You use display: flex;, then can add justify-content: x to align items horizontally and to align items vertically use align-items: y.

#pond {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

##CSS Selection

Check out http://flukeout.github.io/

###Justify Content

justify-content aligns items horizontally. This property can have these values:

###Align Items

align-items aligns items vertically. This property can have these values:

####Align Content

align-content sets how multiple lines are spaced apart from each other. This property can have these values:

####Align Self

align-self Gives you control over individual items vertically. Say everything should be on the top, but your yellow item wants to be on the bottom.

#pond {
  display: flex;
  align-items: flex-start;
}

.yellow {
  align-self: flex-end;
}

###Flex Direction

flex-direction changes the direction. E.g. We have: G Y R, but need R Y G so we use flex-direction: row-reverse. This property can have these values:

####Order

If you need more than flex-direction, you can specify a specific order. By default items have a value of 0. We can set items to a positive or negative value (e.g. order: 1; would put an item last)

#pond {
  display: flex;
}

.shouldbefirst {
  order: 0;
}

.shouldbelast {
  order: 1;
}

###Flex Wrap

flex-wrap specifies whether items wrap around the line or not.