Materialize: Center class not working for a nested button

Created on 29 Mar 2017  路  7Comments  路  Source: Dogfalo/materialize

Description

When a Submit button is a child to a div with class row the class center is giving the same result as class left whereas right works perfectly fine.

Repro Steps

make a submit button a child to div tag.

<div class="row">
    <button class="btn waves-effect waves-light center" type="submit" name="action">Submit
        <i class="material-icons right">send</i>
    </button>
</div>

Most helpful comment

The class .center just applies text-align: center. For floating I see just .left and .right here.

Try using .center-align or .center on the .row (the parent element / wrapper).

See here

All 7 comments

The class .center just applies text-align: center. For floating I see just .left and .right here.

Try using .center-align or .center on the .row (the parent element / wrapper).

See here

@DanielRuf Thanks for helping me out but even after applying .center-align and .center on the parent wrapper the float doesn't seem to be fixed. Unable to place button in the center still.

@Shivang-Bhandari can you provide a codepen of your code based on my codepen?

You forgot to remove the right class: http://codepen.io/anon/pen/peQagE

@DanielRuf Thank you so much for helping me out

You are welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ReiiYuki picture ReiiYuki  路  3Comments

acierpinski picture acierpinski  路  3Comments

djensen47 picture djensen47  路  3Comments

ruslandzhumaev picture ruslandzhumaev  路  3Comments

hartwork picture hartwork  路  3Comments