The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Google Custom Search issues

  • This topic is empty.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #150043
    Kevin Mamaqi


    I’m developing a website right now and I’m using Google Custom Search and the new Bootstrap reset and grid system.

    The problem here is with that the image of the GCS button, here you got an image and here is the codepen link isn’t displaying properly.

    I’m stuck (and more after I use codepen), so any help would be appreciated.



    Did you want the image that big ? Basically, the image is too small to be stretched that large. You could just bump up the padding. Demo

    Also your mockup doesn’t seem to have an icon ?

    Kevin Mamaqi

    Hello georgearnall,

    My image isn’t a mockup is a pic of my website in localhost and no, I don’t wan’t the image so big, I just copied the code that I can see with firebug.

    The code is loaded by google, so I only can override it.

    Viewing your code I changed this and it works:

    height: auto;
    min-width: auto;

    Of course in my case adding !important after to override it.
    Here is the link.

    Thank you.

    PD: I still can’t understand why this happens.


    Just set up a CSE to test this and its working alright. It must be something you have changed in your settings so it might be worth taking a look.

    The original styling for the image looks like this:
    width: 13px;
    height: 13px;
    padding: 6px 27px;
    min-width: 13px;
    margin-top: 2px;

    (For some reason the block code format is not working)

    Kevin Mamaqi

    Hello again and sorry for the long time with no response.

    I still have problems with Google CSE. I created a new one because I didn’t find the reason of the trouble and now everything is getting worst.

    The site is now online (URL) and nothing appears, I really don’t know why.

    The Google CSE is at the right of the menu.

    Any ideas?



    It appears to be commented out in your HTML.

    Kevin Mamaqi

    Hi Paulie_D,

    You are right, but this was the old searchform, I commented it. Now is only the new one and nothing appears.


    So where is the code for the new one in your HTML?

    There’s this


    Not sure what the heck that is.

    However, my guess is that you are missing a script or something.

    Kevin Mamaqi

    Is in the menu, at the right, but doesn’t display nothing and I don’t know why:

    <div class="col-md-4 busqueda">
      (function() {
        var cx = 'partner-pub-CCCXXXCCCXXXCCCXXXCCC';
        var gcse = document.createElement('script');
        gcse.type = 'text/javascript';
        gcse.async = true;
        gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//' + cx;
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(gcse, s);

    Is that the ONLY script that is required?

    On looking at the previous examples in this thread it look like 2 were needed.

    Like this?

    <script type="text/javascript" async="" src=""></script>
    Kevin Mamaqi

    Yes, because the script that are you mentioning in the last comment is loading in the head of my site.

    But I’m not very sure why.


    I can only suggest you review the documentation on the mark-up need to create the search box etc.

    This on inspection seems quite different from you have.

    Kevin Mamaqi

    I don’t know what is going wrong.

    I had changed my Google CSE configuration and now is working.

    I was using Two Columns option (in the design) and now I’m using Two Pages option, now it works.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.