I’m just curious but: Why doesn’t text-align: centre;
work on its own?
for example:
I want to centre a piece of text I’d write:
#centre-text {
text-align: centre;
}
but no! To use it you must type:
#centre-text {
width: /*Width*/;
margin: 0 auto;
text-align: centre;
}
Why? I can understand having to use width, but why margin?
Another thing is it’s essential to use 0 auto in the margin. Why?
I’ve noticed it’s not just for text-align. it’s also for justify-content,
what is the reason for this syntax? As I can’t find an explanation that makes sense…