Re: center two inline elements



On 13 Sep, 06:48, Lanmind <LANMIN...@xxxxxxxxx> wrote:
Hello all,

Quick question, is it possible to center two inline elements next to
each other inside a block level element?

I have an input text box and input submit button next to each other
inside a <div>, I would like to have both elements next to each other
but still centered inside the <div>.

div { text-align: center }

The elements have id's "text" and "submit" and the <div>'s id is
"main_search".

Here is my page and CSS:

http://www.dockhawk.com/default_test.html

Try to use a stripped down test case.

http://www.dockhawk.com/default_test.css

#main_search {
[...]
/*width: 496px;*/
text-align: center;
[...]
}

.



Relevant Pages

  • Re: center two inline elements
    ... each other inside a block level element? ... inside a <div>, I would like to have both elements next to each other ... div {text-align: center} ... center; but I have some worries about that. ...
    (alt.html)
  • center two inline elements
    ... is it possible to center two inline elements next to ... each other inside a block level element? ... inside a <div>, I would like to have both elements next to each other ... Here is my page and CSS: ...
    (alt.html)
  • Re: From table to css on IE6...
    ... to all the inner divs. ... when using text-align. ... So if the outer div uses ... any block level element should be centered, ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Browser
    ... exact CSS replacement for CENTER (`text-align: ... DIV is `a generic mechanism for adding structure to documents'; ... Using CSS, for example, you could achieve *the same effect* as follows: ...
    (comp.sys.acorn.misc)
  • Re: Netscape & CSS
    ... Basically if you imagine each number represents a <div>, ... sectional 's (TOP, MIDDLE & BOTTOM). ... Here is my CSS: ... not at all sure about inline elements, but having toyed with other values, ...
    (alt.html)