Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    14
    Thanks
    2
    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:

    test.sylvainvansteelandt.be/pages/home.html

    Thanks in advance

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    On line 29 of main.css:

    Code:
    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:

    Code:
    #searchbox {
        width: 50px;
    }
    Last edited by Sammy12; 09-21-2012 at 09: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
    •