Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2012
    Thanked 0 Times in 0 Posts

    Google Custom Search Box

    I'm developing a new homepage and I have a little problem with the css. I have a Google Custom Search Box that i wrapped into a div to change the width. But when I change the width, the width of the header is also changed. The header should always stay 960px, because the wrapper of the whole page is set to 960px. You can check the HTML and CSS, and see the problem on:


    Thanks in advance

  2. #2
    Registered User
    Join Date
    Jun 2011
    Thanked 241 Times in 240 Posts
    On line 29 of main.css:

    header {
        float: left; /* delete */
        padding: 10px;
        margin: 10px 0;
        background-color: #0D0D0D;
        overflow: hidden; /* add */
    When you float something, it no longer is in the normal flow of the page, therefore it will not respect the width and margin: 0 auto you set on the #wrapper.

    In order to change the width of the searchbox (and the input):

    On line 44 of main.css:

    #searchbox {
        width: 50px;
    Last edited by Sammy12; 09-21-2012 at 10:39 PM.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts