I have a problem when using a class to center my span :
.center { float:none; margin-left: auto; margin-right: auto; } <div class="row-fluid"> <div class="center span5"> <button></button> </div> </div>
This does not work, apparently it is overridden by the row- * CSS bootstrap. However, if I include the same style in the div directly ( style="..." ), it works.
I think this does not work because it does not know the width, so I tried to use the offset, but when the button is not centered, and also with .CSS. I cannot specify the width, since my button width is set by external JavaScript.
How can I make the .center class work in this case?
source share