+ 1

Webpage Styling

When the text is too long to fit in one line, it wraps but the remainder doesn't align to center. can i fix this without writing a whole div element for "one" small element or is this unavoidable? How do I style text to wrap down center instead of to left?

1st Jul 2018, 3:44 PM
Joshua Morgan
Joshua Morgan - avatar
6 Answers
+ 5
Hello, Joshua Morgan ! Try this solution, I think it will help you <style> p { word-wrap:break-word; text-align:center; } </style> <p>Blue bird</p> https://www.sololearn.com/learn/CSS/1090/?ref=app
1st Jul 2018, 3:55 PM
Alexander Sokolov
Alexander Sokolov - avatar
+ 4
p { text-align: center; }
1st Jul 2018, 3:49 PM
CalviŐ˛
CalviŐ˛ - avatar
0
Yes! Thank you. :)
1st Jul 2018, 3:56 PM
Joshua Morgan
Joshua Morgan - avatar
0
text-align:center;
1st Sep 2018, 11:11 AM
Aung Chan Myae
Aung Chan Myae - avatar
0
I would go with word wrap
1st Sep 2018, 3:31 PM
Terry Pointer (Artistic lover)
Terry Pointer (Artistic lover) - avatar
0
text-align center
1st Sep 2018, 11:42 PM
Gerald
Gerald  - avatar