I am trying to create a button having some text over it. But the text is not wrapping on the button. Here is what i have done.
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-6">
<input type="radio" id="1" class="hidden">
<label for="1" class="btn btn-info btn-preference pull-right">Stability</label>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<input type="radio" id="1" class="hidden">
<label for="1" class="btn btn-primary btn-preference text-center">
<span class="break-wo">Freedom and Risk</span>
</label>
</div>
</div>
Here is the Link for bootfly
Introduction of Wrap Bootstrap The bootstrap wrap is used to cover or wrap the flex items in a flex container.It has main three classes which is.flex-wrap,.flex-nowrap,.flex-wrap-reverse.First is.flex-wrap for wrapping flax content. Second is.flex-nowrap for no wrapping in flex container.
Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers such as Chrome and Safari. CSS: Word-Wrap Property (view demo) You can specify either normalor break-wordvalue with the word-wrap property. Normalmeans the text will extend the boundaries of the box. Break-wordmeans the text will wrap to next line.
For example, you can use it to prevent text extending out the box and breaking the layout. This commonly happens when you have a long URL in the sidebar or comment list. Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers such as Chrome and Safari.
In fact, word-wrap:break-word sometimes does not properly if an element has no width determined, or it is determined with relative values (e.g. %). Reply wisadl Dec 10, 2010 at 4:05 am
It's not the wrap, it's white-space: nowrap;
which is preventing the text to wrap when used .btn
which contains white-space: nowrap;
so use white-space: normal;
label[for="1"].btn {
white-space: normal;
}
Demo
Note: Your ID
value is invalid, you cannot start an id
with a number
Have you tried adding white-space: normal;
to your span class="break-wo"
? This should help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With