Reputation: 24103
I am using twitter bootstrap. Here is my code:
<div class="control-label">
We
<div class="btn-group">
<a href="javascript:;" data-toggle="dropdown" class="btn dropdown-toggle">
<span>search</span> <span class="caret"></span>
</a>
</div>
Something
</div>
How can I make the texts and the button appear in one line aligned to the left using thw twitter bootstrap classes?
Upvotes: 0
Views: 221
Reputation: 17379
If you want to stick strictly to classes, you can try .btn-toolbar
but you won't have the vertical alignment.
<div class="control-label btn-toolbar">
<!-- ... -->
</div>
Floating doesn't seem to be an appropriate solution because you loose the line continuity. So you shouldn't use .pull-left
.
Otherwise there are several solutions :
First of all you could remove the div.btn-group
since apparently you are not using it.
Or you could use display: inline-block;
on all elements (but you should enclose text in blocks).
.myClass > div {
vertical-align: middle;
display: inline-block;
}
<div class="control-label myClass">
<div>We</div>
<div class="btn-group"><!-- ... --></div>
<div>Something</div>
</div>
Upvotes: 1