- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
How i can give text center position. please watch this example
Link
and when i write some text he can stay only in center position. Please help)
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;
}
I mean position center only tag p without width:100%;
tag p occupy only the desired width like display:inline;
I want to see my gray block)
@Atelierbram explained that
Paulie_D, That what i mean. Thanks
text-align in div#line like margin:0 auto; ?
text-align in div#line like margin:0 auto; ?
No…like this.
div#line {
text-align: center;
}
anyway thanks guys.