Google search bar - need help with html code to centre it

Discussion in 'AdSense' started by addictedtotreacle, Apr 14, 2011.

  1. #1
    Hello,

    I need some help with my coding. I want the google search bar to be centred in the middle rather than the right hand side.

    anybody any idea how to do this plese?

    This is what i have so far:

    <style type="text/css">
    @import url(//www.google.com/cse/api/branding.css);
    </style>
    <div class="cse-branding-right" style="background-color:#FFFFFF;color:#000000">
    <div class="cse-branding-form">
    <form action="http://onlinechecker.info" id="cse-search-box">
    <div>
    <input type="hidden" name="cx" value="partner-pub-8843825154778052:c7dyxzoihh9" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="20" />
    <input type="submit" name="sa" value="Search" />
    </div>
    </form>
    </div>
    <div class="cse-branding-logo">
    <img src="//www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" />
    </div>
    <div class="cse-branding-text">
    Web Search


    Thanks
     
    addictedtotreacle, Apr 14, 2011 IP
  2. learn2earn

    learn2earn Well-Known Member

    Messages:
    1,383
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Hey Add the following HTML Code

    <p style="text-align: center;">Your Complete Code here</p>

    That will work out..
    Thanks
    Yo Patel !!!
     
    learn2earn, Apr 14, 2011 IP
  3. addictedtotreacle

    addictedtotreacle Member

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #3
    Hi, thanks for your help :)

    I have tried that but it dose not work:

    <p style="text-align: center;"><style type="text/css">
    @import url(//www.google.com/cse/api/branding.css);
    </style>
    <div class="cse-branding-right" style="background-color:#FFFFFF;color:#000000">
    <div class="cse-branding-form">
    <form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
    <div>
    <input type="hidden" name="cx" value="partner-pub-8843825154778052:c7dyxzoihh9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="77" />
    <input type="submit" name="sa" value="Search" />
    </div>
    </form>
    </div>
    <div class="cse-branding-logo">
    <img src="//www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" />
    </div>
    <div class="cse-branding-text">
    Custom Search</p>

    At first I though there was something wrong with my site but its the same else where. Copy and paste the code into here - http://www.w3schools.com/Html/tryit.asp?filename=tryhtml_intro

    Any more idea??

    Many thanks Im really really greatful :)




     
    addictedtotreacle, Apr 14, 2011 IP
  4. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,337
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #4
    <div align="center" style="float:left;clear:both;">Your Code</div>
    HTML:
     
    Abhik, Apr 14, 2011 IP
  5. soniagupta188

    soniagupta188 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Simple way try it out..
    <center>your code</center>
     
    soniagupta188, Apr 14, 2011 IP
  6. addictedtotreacle

    addictedtotreacle Member

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #6
    Thanks digitech but it still dose not work :/

    Im not an expert in this but id have thought that would have worked :S maybe its something to do with google or something in there html coding thats it dose not work with ??

    <div align="center" style="float:left;clear:both;"><p style="text-align: center;"><style type="text/css">
    @import url(//www.google.com/cse/api/branding.css);
    </style>
    <div class="cse-branding-right" style="background-color:#FFFFFF;color:#000000">
    <div class="cse-branding-form">
    <form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
    <div>
    <input type="hidden" name="cx" value="partner-pub-8843825154778052:c7dyxzoihh9" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="77" />
    <input type="submit" name="sa" value="Search" />
    </div>
    </form>
    </div>
    <div class="cse-branding-logo">
    <img src="//www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" />
    </div>
    <div class="cse-branding-text">
    Custom Search</div>

    Copy and paste the code into here to see how the code looks - http://www.w3schools.com/Html/tryit....=tryhtml_intro






     
    addictedtotreacle, Apr 14, 2011 IP
  7. addictedtotreacle

    addictedtotreacle Member

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #7
    Sonia - again this dose now work - im very puzzled !! Any other ideas anybody ????

    Copy and paste the code into here to see how the code looks - http://www.w3schools.com/Html/tryit....=tryhtml_intro



     
    addictedtotreacle, Apr 14, 2011 IP
  8. soniagupta188

    soniagupta188 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I am not much into complex coding.
    I know simpler one.
     
    soniagupta188, Apr 14, 2011 IP
  9. sasanko

    sasanko Active Member

    Messages:
    107
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    55
    #9
    Change

    <div class="cse-branding-right" style="background-color:#FFFFFF;color:#000000">

    to

    <div class="cse-branding-center" style="background-color:#FFFFFF;color:#000000">
     
    sasanko, Apr 14, 2011 IP
  10. soniagupta188

    soniagupta188 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Ya this should work..
    Or use any web designing tool..
     
    soniagupta188, Apr 14, 2011 IP
  11. addictedtotreacle

    addictedtotreacle Member

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #11
    fantastic !!! that simple too :D many many thanks for everybodies help i am ever so greatful :)
     
    addictedtotreacle, Apr 15, 2011 IP
  12. sasanko

    sasanko Active Member

    Messages:
    107
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    55
    #12
    If it was simple html the previous solutions may have worked but as its using css you have to call the right css class.
     
    sasanko, Apr 15, 2011 IP
  13. maree

    maree Peon

    Messages:
    222
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    you check your themes and go to design and check your header status and than past your code
     
    maree, Apr 15, 2011 IP