Why doesn't text-align center work on my div?
Text-align only affects inline content inside a block container. If your div has no inline text or only block children, you won't see the effect.
💡 Text-align centers inline text inside the container, not block-level child elements.
Why is my text still left aligned after setting text-align center?
If you apply text-align to a parent container, but the text is inside a child element with its own text-align, the child's setting overrides the parent.
💡 Child elements' text-align overrides parent container's text-align.
Why doesn't text-align affect vertical alignment?
Text-align only controls horizontal alignment of inline content. Vertical alignment requires different CSS properties like line-height or flexbox alignment.
💡 Use text-align for horizontal alignment only.