Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to left align the label in a button

How do I get a material UI button to left align the label? There are no props to directly change the inline-styles on the button element and the only way I can figure to do this is to add a class and write some gross css selector like thisClass > div > button.

http://www.material-ui.com/#/components/raised-button

like image 672
Trattles Avatar asked Sep 02 '16 17:09

Trattles


People also ask

How do I align a button to the left in HTML?

Left, Right, and Center Align Button Using CSS Text Align Property To align the button to the left position, you have to use the CSS text-align property with left as its value and place the button inside the <div> element.

How to align the buttons in Bootstrap?

Well, you have to first wrap the buttons inside the div element and use the Bootstrap classes given below to align the buttons:- 1 .text-left: Use to align button to the left position. 2 .text-center: Use to align button to the center position. 3 .text-right: Use to align button to the right position.

How to right align labels next to inputs?

Example of right aligning labels next to inputs with the text-align property: We can remove the text-align property, and the labels will be left-aligned by default. Let’s see an example, where we also add placeholder, id and name attributes on inputs and for attribute on labels. As a result, the input will be activated when a label is clicked.

How do I center align a button in a Div?

Left Align Button. Right Align Button. Probably, you may also like to adjust the button to the center position. The CSS text-align property can also be used to set the button to the center position. You have to use center as the property value and place the button inside the <div> element to move the button to the center position.


1 Answers

I had a similar issue with buttons that have an icon. I fixed it by justifing the content:

<Button 
  startIcon={<AccountCircleIcon/>}
  fullWidth={true}
  style={{justifyContent: "flex-start"}}>
  button text
</Button>
like image 137
Marc Steffens Avatar answered Nov 16 '22 11:11

Marc Steffens