how to place div next to centered div css


Tags: css,html,css-float

Problem :

I have a search page that contains a textbox for the search and a link that says "advanced search" similar to google.

I am having trouble centering the textbox AND having 'Advanced Search' to the right of the textbox.

Basically I want the layout to look like googles http://www.google.com/'>See here

This was my shot:

            <div style="width:650px; margin-right:auto; margin-left:auto;">
                <%= Html.TextBox("SearchBar")%>
            </div>
            <div style="width:90px; float:right;">                    
                <a href="#" style="text-decoration:none">Advanced Search</a>
            </div>


Solution :

Google uses a table to display their search box. The left and right columns have widths of 25% and the center column has a width of 50%. The search box is in the center column and the "Advanced Search" is in the right column. The left column is empty.

Then just center the table. Your search box will be centered and "Advanced Search" will appear on the right.


    CSS Howto..

    Getting an error message to show up inline of input

    Jquery-How to grey out the background while showing the loading icon over it

    How to make background fill or flush to the footer at the bottom of the window

    How to append text after last css class

    How do I set two values for IE's `filter` property?

    Learn how to arrange elements correctly using CSS [closed]

    How to change font-awesome icon color when it is active

    How to write regular expressions in CSS

    How to center image using CSS without white border

    How to center social buttons in bootstrap login page?

    Shadow-Piercing descendant combinator, '/deep/' , including '::shadow' pseudo elements, are being deprecated so how do we pierce the Shadow DOM?

    How to select that has no “type” with CSS

    How to add image, that overlapping Bootstrap modal?

    Hover img to show an absolutely positioned div isn't working

    How can i add a preload function for my images?

    Basic CSS Question: How to specify height of background image of div?

    Advanced CSS tricks: How to span an image over multiple columns in a CSS3 site layout?

    How to wrap text in a element in IE

    Php - Javascript - How do I know which pages are in color and which are in black and white?

    How to get the complete css information if css class is given form the used style sheets files

    Does anybody know how I can adjust this CSS to achieve the desired hyperlink effect I'd like?

    JQuery show delete button on appended div

    how to override theme in primefaces on Dialog window and set user define CSS

    CSS: How to create a button with an arrow placedo on the right

    How to overlap elements inside of a ng-repeat list - position: absolute?

    Slideshow image with buttons

    How do I apply CSS styles to Raphael.js objects using jQuery?

    how to make the text in a div to not overflow its width

    How to create a line break instead of having text going on top of itself?

    How to change the colors of a website in real time?