I'm trying to align an input text and all the buttons you see in the following image to the bottom of "My text".
The bottom should be the bottom of the M not the bottom of the y. Edit: as a second choice, all the elements can be aligned to the vertical center of `my text'.
Buttons 3 and 4 have to be aligned to the right.
If there isn't enough space, My text
should remain on the first line, and the rest should go into a new line.
I tried using float: right
with no luck, because button 3 and 4 go to the right upper edge. I tried displaying them inline, but that way they are not aligned on the right. I don't know what else to try.
My current code is the following, which gives me bottom alignment with Firefox but not with Chrome (as you can see, buttons 3 and 4 are not aligned with buttons 1 and 2)
I hope someone can help me.
div.inline {
display: inline-block;
}
<div id="titleBar">
<div class="inline" style="position: relative; width: 100%;">
<div class="inline" style="font-weight: bold; font-size: 2em; color: #D00000;">My text</div>
<div class="inline">
<form>
<div class="inline">
<input type="text" style="width: 16em" value="input text">
</div>
<div class="inline">
<input type="submit" value="button 1"></input>
<button>button 2</button>
</div>
</form>
</div>
<div style="position: absolute; bottom: 0px; right: 0px;">
<button >button 3</button>
<button >button 4</button>
</div>
</div>
</div>