Here are a bunch of incredibly useful CSS tricks that will help you design great websites. You might already know some or all of these techniques, but this can be your handy resource to handy CSS tricks that you should know.
1. Align Elements Vertically
Nowadays CSS3 makes vertical alignment really simple!
Just add to the parent <div> this css:
display:flex; align-items:center; justify-content:center;
2. Align Elements Vertically
Add to the parent <div> this css:
3. Fit background image to div
You can achieve this with the background-size property, which is now supported by most browsers.
To scale the background image to fit inside the div:
To scale the background image to cover the whole div: