Shanthamma DS Shanthamma DS - 6 months ago 24
HTML Question

button alignment in css

I have declared the button as,

<button id='submitExpectedJ0' type='button'></button>


I need to align it to right, i tried with

style= 'float: right;'


on the widget ID it didnt work,
In chrome its shown as,

<span class="dijit dijitReset dijitInline dijitButton dijitButtonHover dijitHover" role="presentation" widgetid="submitExpectedJ0">


May be the style is overriden by this class.

How to align the button to right?

Answer

Try to wrap your button in a div or span, setting the width of the div/span to 100% and include text-align:right as part of the style. something like:

<div style="width:100%;text-align:right">
    <button id='submitExpectedJ0' type='button'></button>
</div>

The float;right may also work once you have the wrapping included.

Comments