CSS center text (horizontally and vertically) inside a div blockAsk a question
I have a div set to
display:block (90px height and width), and I have some text inside.
I need the text to be aligned in the center both vertically and horizontally.
I have tried
text-align:center, but it doesn’t do the horizontal part, so I tried
vertical-align:middle, but it didn’t work.
- 0What is the best way to align elements to vertically center in CSS
- 1Keep up aspect ratio of a div with CSS
- 1Search text in files that have only specified extension
- 0Social Login - Icon only or Icon with Text?
- 0Why iterators are inside container classes
- 0C++ book guide and list
- 0undefined behavior and sequence points
- 1main function signature in C and C++
- 0What is the copy-and-swap idiom
- 0Pointless if-else and do-while in
- 0Difference between copy initialization and direct initialization