Reputation: 86925
I'm trying to align a button to the right, whereas some other text is placed in the same line aligned to the left:
<h1 style="display:inline; text-align:left">
<span>somevalue</span>
</h1>
<input type="submit" value="somevalue" style="vertical-align:top; text-align: right"/>
Result: the vertical alignment takes place. the align to the right does not. Does anyone know why? Or a workaround?
Upvotes: 0
Views: 13919
Reputation: 431
You can use float:left and float:right
<h1 style="display:inline; float:left">
<span>somevalue</span>
</h1>
<input type="submit" value="somevalue" style="vertical-align:top; float: right"/>
Upvotes: 3
Reputation: 85799
You have to put the button inside a div and set the div with right align:
<div id="someDiv" style="display:inline; text-align:right">
<h:commandButton value="somevalue" style="vertical-align:top"/>
</div>
Upvotes: 2