The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] How i can give text center position Reply To: [Solved] How i can give text center position


Setting the p element to display: inline (from default block value) changes it’s box, text-align: center will work, but only on that smaller box (so will have no detectable visual difference). When removing that display property and value, and add: text-align: center will make it centered aligned.

div#line p.line-item1 {
  margin:0 auto;
  /* display:inline; */
  text-align: center;
  outline:1px solid red;