I want the help-block to be inline with the input-field (if there is space available to the right of the input-field), but it is below the input-field no matter how wide the screen is. How can I make it inline?
Here is the form:
<form class="form-inline" role="form">
<div class="form-group">
<label for="query">Search</label>
<input type="text"
ng-model="query"
class="form-control"
id="query"
placeholder="Enter search text">
<span class="help-block">
Search in any field...
</span>
</div>
</form>
And here is a plunk.
Use the d-inline-block class to create a inline-block element. Add breakpoints (sm, md, lg, xl, and xxl) to the classes (d-*-inline-block) to control when the element should be a inline-block element based on the screen width. Resize the browser window to see how it works.
d-inline-block to simply set an element's display property to block , inline , or inline-block (respectively). To make an element display: none , use our responsive utilities instead. Inline. Inline. <div class="d-inline bg-success">Inline</div> <div class="d-inline bg-success">Inline</div>
Hiding elementsTo hide elements simply use the . d-none class or one of the . d-{sm,md,lg,xl,xxl}-none classes for any responsive screen variation. To show an element only on a given interval of screen sizes you can combine one . d-*-none class with a .
Horizontal formCreate horizontal forms with the grid by adding the .row class to form groups and using the .col-*-* classes to specify the width of your labels and controls. Be sure to add .col-form-label to your <label> s as well so they're vertically centered with their associated form controls.
One of the things .help-block
does is set display:block
. If you don't want that, you can override it like this:
.help-block {
display: inline;
}
/* Make the help displayed horizontally and set with same color with help-block */
.help-inline {
display: inline;
color: #737373;
}
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