tags:

views:

211

answers:

3

i have a div.I want the input box to place at its center .how can i do this??

+1  A: 
#the_div input {
  margin: 0 auto;
}

I'm not sure if this works in good ol' IE6, so you might have to do this instead.

/* IE 6 (probably) */
#the_div {
  text-align: center;
}
August Lilleaas
thanks for helping me .
A: 
#input_box {
    margin: 0 auto;
    text-align: left;
}
#div {
    text-align: center;
}

<div id="div">
    <label for="input_box">Input: </label><input type="text" id="input_box" name="input_box" />
</div>

or you could do it using padding, but this is not that great of an idea.

Tom
A: 

Try this website it shows you how to centre things in a div and or text. Dorward

Cool Hand Luke UK