user3239377
user3239377

Reputation: 3

Aligning the button in a grid to center

I have the code below

<li class="ui-body ui-body-b">
                <fieldset class="ui-grid-a">
                        <div class="ui-grid-solo"><button id="btn1" type="submit"  >Submit</button></div>
                </fieldset>
            </li>

if i am using this the button is not center.. how place it in center

Upvotes: 0

Views: 11536

Answers (3)

G.L.P
G.L.P

Reputation: 7207

I dont have idea about your css code. generally, to align some element in center you can use something like this

CSS:

 div.center{
    margin:0 auto;
    display:block;
    text-align:center; 
 }

HTML:

<div class="ui-grid-solo center"><button id="btn1" type="submit"  >Submit</button></div>

Upvotes: 2

Sulthan Allaudeen
Sulthan Allaudeen

Reputation: 11310

Here is the Fiddle.

Just add the following code in your css.

button{
    position: relative;
    left: 50%;
}

Upvotes: 2

user1166905
user1166905

Reputation: 2622

I have found using text-align in css will work:

.ui-grid-solo { text-align:center; }

Upvotes: 0

Related Questions