Text-Align

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… :man_shrugging:t4:

It works on its own. In your example, just the margin: auto style is applied.
For text-align: center; you have to use american english. (center – not centre)

1 Like

Oooh, My Bad! Thanks For your help! :smiley:

1 Like

hI
i need your GUIDIANCE help in python

[email protected]