@haquanq
Posted
Hello 👋
About centering elements
- If you want to center a single element horizontally, you can use
margin-left: auto
andmargin-right: auto
ormargin: 0 auto
for short. - When you want to center more than 1 element at the same layout then it's better to use
display: flex
which allow more control over how elements are placed (read more here)
Keep it up, happy coding 👨💻
Marked as helpful
@larryQuao
Posted
Thanks, @haquanq, will keep that in mind and practice it...