0

How align paragraph in centre

31st Dec 2016, 4:33 AM
Prithviraj
3 ответов
+ 2
margin: auto only works on block displaying elements, css can't calculate auto margin for inline elements, to center the text in a tag, use text-align:center, to center the p element it self wrap it in a div or any block container, or set its display to block, then you can use margin: auto.
31st Dec 2016, 5:07 AM
ADEL MAHJOUB
ADEL MAHJOUB - avatar
0
you can use this in css p { margin: 0 auto; } this will align the paragraph horizontally
31st Dec 2016, 4:38 AM
Alejandro Aristizabal
Alejandro Aristizabal - avatar
0
thanks
31st Dec 2016, 4:38 AM
Prithviraj