CSS Alignment Styling ! | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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