Shanthamma DS Shanthamma DS - 1 year ago 128
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 Source

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>

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download