Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap text align top center

Is it possible to align text top and center (for example) using bootstrap.

I have tried using:

<label class=text-align-top text-align-center></label>

It does not seem to work.

like image 602
JustLearning Avatar asked Feb 08 '23 08:02

JustLearning


1 Answers

I believe you probably wanted to have this instead:

<label class="text-align-top text-align-center"></label>

(adding quotes around the CSS class names)

This would assume, however, that you have defined both, text-align-top and text-align-center classes in CSS, as no such classes exist in Twitter-Bootstrap.

If you want to do this the Twitter-Bootstrap-way, you can simply use the Alignment classes, which will take care of horizontal alignments. In your case you'd use text-center.

There are no vertical alignment classes in twitter-bootstrap, so you're going to have to set it up yourself using vertical-align: middle; on your targeted element, or create your custom CSS class having that, ie...

CSS:

.vertical-align-top {
    vertical-align: top
}

HTML (with twitter-bootstrap):

<label class="vertical-align-top text-center"></label>
like image 181
benomatis Avatar answered Feb 13 '23 07:02

benomatis