I want to make the Submit button's length same as the input field above it.
<div class="row">
<div class="input-field col s12">
<input id="speciality" type="text" class="validate">
<label for="speciality">Speciality</label>
</div>
</div>
<div class="row">
<button class="btn waves-effect waves-light" type="submit" name="action">Search
<i class="material-icons right">search</i>
</button>
</div>
If your column which you have your input field in is limited to a certain width (in the way how the Bootstrap columns work), you can put the .btn
inside a column as well.
After that, you can use the following CSS to make the width equal to the input field:
.col.s12 > .btn {
width: 100%;
}
Of course if the button
as an element does not bend to this CSS-rule, you can use <a class="btn">
instead.
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