Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
111
rated 0 times [  113] [ 2]  / answers: 1 / hits: 69832  / 5 Years ago, sat, may 18, 2019, 12:00:00

I am trying to align a button to the most right yet not sucessfull. Here is my attempt.





<Button variant=contained style={{display: 'flex', justifyContent: 'right'}} color=primary className=float-right onClick={this.onSend}>




More From » html

 Answers
31

You need to add display flex to the parent element of your Button.



See sandbox here for example: https://codesandbox.io/s/testproviderconsumer-klcsr



class App extends React.Component {
render() {
return (
<div style={{ display: flex }}>
<button
style={{ marginLeft: auto }}
>
Click
</button>
</div>
);
}
}


{{display: 'flex', justifyContent: 'flex-end'}} are defined in the parent element to align items in the child element.


[#52102] Monday, May 13, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bryantc

Total Points: 455
Total Questions: 96
Total Answers: 110

Location: San Marino
Member since Thu, Jun 30, 2022
2 Years ago
bryantc questions
Fri, Aug 13, 21, 00:00, 3 Years ago
Tue, Mar 30, 21, 00:00, 3 Years ago
Fri, Jun 5, 20, 00:00, 4 Years ago
Wed, May 27, 20, 00:00, 4 Years ago
;