All CSS Properties You Need to Know to Build a Website
It’s easy to get lost in them
Whether you’re at the beginning of your CSS journey or somewhere else, you got to admit — a number of CSS properties is massive.
And it’s easy to confuse yourself in that vast sea.
You’re copying code from StackOverflow until you find a solution that fits. But how will that scale? Why does it even work?
Most of the time, you don’t care about the answer. You just focus on the result.
When building a website, some of the CSS properties are must-haves; yet, it’s hard to recognize them.
This article exists to help you solve the most common CSS problems while building a website.
Let’s dive into properties you cannot avoid.
1. display: flex;
Do you need to center an element?
Googling that will likely offer tens of different solutions; however, you’ll need only one most of the time.
.your-class-name {
display: flex;
justify-content: center;
align-items: center;
}
display: flex;
will align your child elements one next to each other in a horizontal row. Tip: you can add flex-direction: column;
to change it to a…