I am trying to achieve the following layout with bootstrap
icon | text | button
icon | text | button
icon | text | button
This is the code I have at the moment, which does not work
<div class="row">
<img src="icon.png" class="col-sm-2"/>
<div class="col-sm-7" style="display: inline-block; vertical-align: bottom; background-color: blue;">
<h4>Text</h4>
</div>
<div class="col-sm-2">
<button type="submit" name="action" value="start" class="btn btn-primary">Button</button>
</div>
</div>
Stripped of the irrelevant parts of course.
I tried everything from a google investigation, but no matter what I tried, the icon is much larger than the text and the button, so I end up with a situation like this
| text | button
icon | |
| |
But I want
| |
icon | text | button
| |
I found some apparent duplicates, but none of them solved it.
Edit: I went for this solution. I cheated a bit in my initial presentation, assuming that it didn't matter, but now I am puzzled. This is the current code.
<style>
.va {
display: inline-block;
vertical-align: middle;
float: none;
}
</style>
<div class="container">
<div class="row col-sm-offset-2 col-sm-8">
<div class="row">
<img src="icon.png" class="col-sm-2 va" />
<div class="col-sm-7 va"><h4>Text</h4></div>
<form enctype="multipart/form-data" action="{{base_url}}" method="post" role="form">
<input type="hidden" name="whatever" value="whatever">
<div class="col-sm-2 va">
<button type="submit" name="action" value="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
With the form element in, the button ends up under the text. If I remove the form element, it works as I expected. How is that possible?