Brainchild
Brainchild

Reputation: 1884

how to place a number in the center of a span tag

I have a span tag which has got rounded circle with the height 30 px and widhth 30 px. I am setting some number to the span tag.

i would like the number should be placed to the center of the circle. but it is moving towards the top center.

i tried setting sytle: text-align:center.

Any help greatly appreciated.

Upvotes: 0

Views: 68

Answers (2)

eCSSpert
eCSSpert

Reputation: 1

This is a complete solution:

.yourSpanClass {
    displ
    line-height: 30px;
    text-align: center;
}

Hope it helps

Upvotes: 0

Boldewyn
Boldewyn

Reputation: 82784

If it's too high, have you tried

line-height: 30px;

yet?

Upvotes: 3

Related Questions