Liam Richardson
Liam Richardson

Reputation: 138

Floating two elements to the right in a flexible container

I'm trying to float two elements (buttons) to the right of a flexible container.

One of the buttons is also flexible, as the text within it changes depending on who's logged into the system.

Any ideas how this can be achieved? Help is much appreciated! I've already tried float rights (the order of the buttons is wrong when I do that) and display: inline-block (doesn't work).

What I'm trying to achieve

Edit:

Code I've tried (that doesn't work). This is psuedo version, as I'm currently overhauling a pre-existing system -

<div style="width: 100%">
   <div style="float:right; text-align: right;">
       <input type="submit" style="display: inline-block"></button>
       <button style="display: inline-block"></button>
   </div>
</div>

Upvotes: 2

Views: 3274

Answers (1)

Sajad Karuthedath
Sajad Karuthedath

Reputation: 15767

It works perfectly..please check your project code completely,

<div style="width: 100%">
   <div style="float:right; text-align: right;">
       <input type="submit" style="display: inline-block"/>
       <button style="display: inline-block">flexible</button>
   </div>
</div>

works perfectly here.. FIDDLE DEMO

Upvotes: 2

Related Questions