I am creating a simple UI for a webapp using React and Ant Design. I would like to place a Button at the top right of the screen. My component render function looks something like this:
return (
<div style={{something here?}}>
<div style={{something else here?}}>
<Button>Logout</Button>
</div>
<div>
{Main components here}
</div>
</div>
);
I have tried adding various things to the outer and/or inner dics and have not been able to move the button to the right - it always stays on the left. How do I make it move to the right?
return (
<div style={{}}>
<div style={{float: 'right'}}>
<Button>Logout</Button>
</div>
<div style={{clear: 'both'}}></div>
<div>
{Main components here}
</div>
</div>
);
Try that, also, this is not a React question, it should be tagged CSS
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