When I install the custom search script on my page, the layout is broken. See the attached screenshot.


I cut and pasted the following code:

  (function() {
    var cx = '000119385509173658979:1gb8nobc8-a';
    var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);

It works but it looks screwed up. How can fix this?


Here's the CSS that fixed it:

.gsc-input-box { background: none !important; border: none !important; height: auto !important; }

.gsc-search-box .gsc-input>input:hover, .gsc-input-box-hover { border: none !important; }

.gsc-search-box .gsc-input>input:focus, .gsc-input-box-focus { border: none !important; }

.gsc-result .gs-title { line-height: 1.5em !important; }

input.gsc-input { border: 1px solid #d9d9d9 !important; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.