Horizontally center

within a div while keeping the text left-aligned

后端 未结 1 1953
花落未央
花落未央 2021-02-13 20:35

I have multiple divs with a fixed width containing

tags which contain various lengths of text.

I want this text to remain left-aligned but if the

相关标签:
1条回答
  • 2021-02-13 21:26

    Set your outer div to text-align: center; and your inner p's to display: inline-block;

    Fiddle: http://jsfiddle.net/ZL4GM/

    0 讨论(0)
提交回复
热议问题