+ 2

CSS Alignment Styling !

Can we justify a center aligned paragraph? Eg: HTML; <p class=“Styling”> Can this paragraph be centered and justified</p>

9th Feb 2018, 1:34 PM
Raaja Thalapathy
Raaja Thalapathy - avatar
6 Answers
+ 26
if you want to get justified paragraph use syntax below p{ text-align:justify; } http://jkorpela.fi/www/justify.html
9th Feb 2018, 3:13 PM
Elizabeth🌾
Elizabeth🌾 - avatar
+ 3
@ihateonions I tried but didn’t work âœŒđŸ»âœŒđŸ»
9th Feb 2018, 3:24 PM
Raaja Thalapathy
Raaja Thalapathy - avatar
+ 3
@elizabeth Thanks 😊, But is it possible to both align right or left or center and justify both at the same time?
9th Feb 2018, 3:25 PM
Raaja Thalapathy
Raaja Thalapathy - avatar
+ 3
@scurrilus Thanks for that tip! đŸ˜đŸ‘ŒđŸ»
10th Feb 2018, 5:51 AM
Raaja Thalapathy
Raaja Thalapathy - avatar
+ 2
try this, text-align: justify; text-align-last: center;
9th Feb 2018, 3:12 PM
ihateonions
+ 2
Only one parameter for text align. You can overwrite it at the next line or an modifier class at your element. Don’t overwrite it on the next line. It works but is not good codestyle. Do it in the following way For example: <p class=“align align—left align—right”>test</p>. And .align { text-align: center} .align—left { text-align: left} .align—right { text-align: right}. The p display the text right aligned. Make shure that you don’t have to many overwrites because your css goes bigger for Code you don’t need. Only one will be use.
9th Feb 2018, 8:01 PM
SCURRILUS
SCURRILUS - avatar