Home › Forums › CSS › [Solved] How i can give text center position › Reply To: [Solved] How i can give text center position
June 2, 2014 at 3:47 am
#171561
Atelierbram
Participant
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;
background:#fff;
}