2017-02-20 2 views
0

Etwas in meinen Stilen ist störend auf den Text in meinem Google Custom Search-Feld.Google Benutzerdefinierte Suche Box Text überläuft eine Zeile

Hier ist ein jsfiddle demonstriert das Problem: https://jsfiddle.net/eykd/xqbfn9z0/

Und hier ist, wie es aussieht:

text overflowing in Google Custom Search box

Hier ist der HTML:

<main> 
    <section class="flow-block text-block"> 
    <div class="container"> 
    <div id="custom-search"> 
     <script> 
     (function() { 
    var cx = '011367616204263736318:7ksxac5v0w4'; 
    var gcse = document.createElement('script'); 
    gcse.type = 'text/javascript'; 
    gcse.async = true; 
    gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; 
    var s = document.getElementsByTagName('script')[0]; 
    s.parentNode.insertBefore(gcse, s); 
    })(); 
     </script> 
     <gcse:search> 
     </gcse:search> 
    </div> 
    </div> 
    </section> 
</main> 

Und meine Stile:

@import 'https://fonts.googleapis.com/css?family=Copse|Lora'; 

/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */ 

/** 
* 1. Change the default font family in all browsers (opinionated). 
* 2. Prevent adjustments of font size after orientation changes in IE and iOS. 
*/ 

html { 
    font-family: sans-serif; /* 1 */ 
    -ms-text-size-adjust: 100%; /* 2 */ 
    -webkit-text-size-adjust: 100%; /* 2 */ 
} 

/** 
* Remove the margin in all browsers (opinionated). 
*/ 

body { 
    margin: 0; 
} 

/* HTML5 display definitions 
    ========================================================================== */ 

/** 
* Add the correct display in IE 9-. 
* 1. Add the correct display in Edge, IE, and Firefox. 
* 2. Add the correct display in IE. 
*/ 

article, 
aside, 
details, /* 1 */ 
figcaption, 
figure, 
footer, 
header, 
main, /* 2 */ 
menu, 
nav, 
section, 
summary { /* 1 */ 
    display: block; 
} 

/** 
* Add the correct display in IE 9-. 
*/ 

audio, 
canvas, 
progress, 
video { 
    display: inline-block; 
} 

/** 
* Add the correct display in iOS 4-7. 
*/ 

audio:not([controls]) { 
    display: none; 
    height: 0; 
} 

/** 
* Add the correct vertical alignment in Chrome, Firefox, and Opera. 
*/ 

progress { 
    vertical-align: baseline; 
} 

/** 
* Add the correct display in IE 10-. 
* 1. Add the correct display in IE. 
*/ 

template, /* 1 */ 
[hidden] { 
    display: none; 
} 

/* Links 
    ========================================================================== */ 

/** 
* 1. Remove the gray background on active links in IE 10. 
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+. 
*/ 

a { 
    background-color: transparent; /* 1 */ 
    -webkit-text-decoration-skip: objects; /* 2 */ 
} 

/** 
* Remove the outline on focused links when they are also active or hovered 
* in all browsers (opinionated). 
*/ 

a:active, 
a:hover { 
    outline-width: 0; 
} 

/* Text-level semantics 
    ========================================================================== */ 

/** 
* 1. Remove the bottom border in Firefox 39-. 
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 
*/ 

abbr[title] { 
    border-bottom: none; /* 1 */ 
    text-decoration: underline; /* 2 */ 
    text-decoration: underline dotted; /* 2 */ 
} 

/** 
* Prevent the duplicate application of `bolder` by the next rule in Safari 6. 
*/ 

b, 
strong { 
    font-weight: inherit; 
} 

/** 
* Add the correct font weight in Chrome, Edge, and Safari. 
*/ 

b, 
strong { 
    font-weight: bolder; 
} 

/** 
* Add the correct font style in Android 4.3-. 
*/ 

dfn { 
    font-style: italic; 
} 

/** 
* Correct the font size and margin on `h1` elements within `section` and 
* `article` contexts in Chrome, Firefox, and Safari. 
*/ 

h1 { 
    font-size: 2em; 
    margin: 0.67em 0; 
} 

/** 
* Add the correct background and color in IE 9-. 
*/ 

mark { 
    background-color: #ff0; 
    color: #000; 
} 

/** 
* Add the correct font size in all browsers. 
*/ 

small { 
    font-size: 80%; 
} 

/** 
* Prevent `sub` and `sup` elements from affecting the line height in 
* all browsers. 
*/ 

sub, 
sup { 
    font-size: 75%; 
    line-height: 0; 
    position: relative; 
    vertical-align: baseline; 
} 

sub { 
    bottom: -0.25em; 
} 

sup { 
    top: -0.5em; 
} 

/* Embedded content 
    ========================================================================== */ 

/** 
* Remove the border on images inside links in IE 10-. 
*/ 

img { 
    border-style: none; 
} 

/** 
* Hide the overflow in IE. 
*/ 

svg:not(:root) { 
    overflow: hidden; 
} 

/* Grouping content 
    ========================================================================== */ 

/** 
* 1. Correct the inheritance and scaling of font size in all browsers. 
* 2. Correct the odd `em` font sizing in all browsers. 
*/ 

code, 
kbd, 
pre, 
samp { 
    font-family: monospace, monospace; /* 1 */ 
    font-size: 1em; /* 2 */ 
} 

/** 
* Add the correct margin in IE 8. 
*/ 

figure { 
    margin: 1em 40px; 
} 

/** 
* 1. Add the correct box sizing in Firefox. 
* 2. Show the overflow in Edge and IE. 
*/ 

hr { 
    box-sizing: content-box; /* 1 */ 
    height: 0; /* 1 */ 
    overflow: visible; /* 2 */ 
} 

/* Forms 
    ========================================================================== */ 

/** 
* 1. Change font properties to `inherit` in all browsers (opinionated). 
* 2. Remove the margin in Firefox and Safari. 
*/ 

button, 
input, 
select, 
textarea { 
    font: inherit; /* 1 */ 
    margin: 0; /* 2 */ 
} 

/** 
* Restore the font weight unset by the previous rule. 
*/ 

optgroup { 
    font-weight: bold; 
} 

/** 
* Show the overflow in IE. 
* 1. Show the overflow in Edge. 
*/ 

button, 
input { /* 1 */ 
    overflow: visible; 
} 

/** 
* Remove the inheritance of text transform in Edge, Firefox, and IE. 
* 1. Remove the inheritance of text transform in Firefox. 
*/ 

button, 
select { /* 1 */ 
    text-transform: none; 
} 

/** 
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` 
* controls in Android 4. 
* 2. Correct the inability to style clickable types in iOS and Safari. 
*/ 

button, 
html [type="button"], /* 1 */ 
[type="reset"], 
[type="submit"] { 
    -webkit-appearance: button; /* 2 */ 
} 

/** 
* Remove the inner border and padding in Firefox. 
*/ 

button::-moz-focus-inner, 
[type="button"]::-moz-focus-inner, 
[type="reset"]::-moz-focus-inner, 
[type="submit"]::-moz-focus-inner { 
    border-style: none; 
    padding: 0; 
} 

/** 
* Restore the focus styles unset by the previous rule. 
*/ 

button:-moz-focusring, 
[type="button"]:-moz-focusring, 
[type="reset"]:-moz-focusring, 
[type="submit"]:-moz-focusring { 
    outline: 1px dotted ButtonText; 
} 

/** 
* Change the border, margin, and padding in all browsers (opinionated). 
*/ 

fieldset { 
    border: 1px solid #c0c0c0; 
    margin: 0 2px; 
    padding: 0.35em 0.625em 0.75em; 
} 

/** 
* 1. Correct the text wrapping in Edge and IE. 
* 2. Correct the color inheritance from `fieldset` elements in IE. 
* 3. Remove the padding so developers are not caught out when they zero out 
* `fieldset` elements in all browsers. 
*/ 

legend { 
    box-sizing: border-box; /* 1 */ 
    color: inherit; /* 2 */ 
    display: table; /* 1 */ 
    max-width: 100%; /* 1 */ 
    padding: 0; /* 3 */ 
    white-space: normal; /* 1 */ 
} 

/** 
* Remove the default vertical scrollbar in IE. 
*/ 

textarea { 
    overflow: auto; 
} 

/** 
* 1. Add the correct box sizing in IE 10-. 
* 2. Remove the padding in IE 10-. 
*/ 

[type="checkbox"], 
[type="radio"] { 
    box-sizing: border-box; /* 1 */ 
    padding: 0; /* 2 */ 
} 

/** 
* Correct the cursor style of increment and decrement buttons in Chrome. 
*/ 

[type="number"]::-webkit-inner-spin-button, 
[type="number"]::-webkit-outer-spin-button { 
    height: auto; 
} 

/** 
* 1. Correct the odd appearance in Chrome and Safari. 
* 2. Correct the outline style in Safari. 
*/ 

[type="search"] { 
    -webkit-appearance: textfield; /* 1 */ 
    outline-offset: -2px; /* 2 */ 
} 

/** 
* Remove the inner padding and cancel buttons in Chrome and Safari on OS X. 
*/ 

[type="search"]::-webkit-search-cancel-button, 
[type="search"]::-webkit-search-decoration { 
    -webkit-appearance: none; 
} 

/** 
* Correct the text style of placeholders in Chrome, Edge, and Safari. 
*/ 

::-webkit-input-placeholder { 
    color: inherit; 
    opacity: 0.54; 
} 

/** 
* 1. Correct the inability to style clickable types in iOS and Safari. 
* 2. Change font properties to `inherit` in Safari. 
*/ 

::-webkit-file-upload-button { 
    -webkit-appearance: button; /* 1 */ 
    font: inherit; /* 2 */ 
} 

/* 
* Based roughly on: 
* Skeleton V2.0.4 
* Copyright 2014, Dave Gamache 
* www.getskeleton.com 
* Free to use under the MIT license. 
* http://www.opensource.org/licenses/mit-license.php 
* 12/29/2014 
*/ 


/* Table of contents 
–––––––––––––––––––––––––––––––––––––––––––––––––– 
- Base Styles 
- Typography 
- Links 
- Buttons 
- Forms 
- Lists 
- Code 
- Tables 
- Spacing 
- Utilities 
- Clearing 
- Flow Blocks 
- Custom Layout 
- Grid 
- Media Queries 
*/ 



/* Base Styles 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 

body { 
    font-weight: 400; 
    font-family: 'Lora', Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; 
    line-height: 1.6; 
    color: #552700; 
    background-color: #372C27; 
    box-sizing: border-box; 
} 

/* Typography 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
h1, h2, h3, h4, h5, h6, b, strong, label { 
    font-family: 'Copse', Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif; 
} 
h1, h2, h3, h4, h5, h6 { 
    font-weight: 400; 
} 


h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { 
    text-decoration: underline; 
} 

/* h1 + *, h2 + *, h3 + *, h4 + *, h5 + *, h6 + * { */ 
/* margin-top: 1em; */ 
/* } */ 

blockquote { 
    border-left: 2px solid #407F7F; 
    font-size: 1.2em; 
} 

/* Links 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
a { 
    color: #D46A6A; 
} 
a:hover { 
    color: #55AA55; 
    transition: none 200ms ease-out; 
    transition-property: color; 

} 



/* Buttons 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
.button, 
button, 
input[type="submit"], 
input[type="reset"], 
input[type="button"] { 
    display: inline-block; 
    height: 38px; 
    padding: 0 30px; 
    color: #555; 
    text-align: center; 
    font-weight: 600; 
    font-size: 1rem; 
    letter-spacing: .1rem; 
    text-decoration: none; 
    overflow: visible; 
    white-space: nowrap; 
    background-color: transparent; 
    border-radius: 4px; 
    border: 1px solid #bbb; 
    cursor: pointer; 
    box-sizing: border-box; 
    transition: none 200ms ease-out; 
    transition-property: color, background; 
} 
.button:hover, 
button:hover, 
input[type="submit"]:hover, 
input[type="reset"]:hover, 
input[type="button"]:hover, 
.button:focus, 
button:focus, 
input[type="submit"]:focus, 
input[type="reset"]:focus, 
input[type="button"]:focus { 
    color: #333; 
    border-color: #888; 
    outline: 0; 
} 

.button.button-primary, 
button.button-primary, 
input[type="submit"].button-primary, 
input[type="reset"].button-primary, 
input[type="button"].button-primary { 
    color: #fff; 
    background-color: #688125; 
    border-color: #A6BF3A; 
} 
.button.button-primary:hover, 
button.button-primary:hover, 
input[type="submit"].button-primary:hover, 
input[type="reset"].button-primary:hover, 
input[type="button"].button-primary:hover, 
.button.button-primary:focus, 
button.button-primary:focus, 
input[type="submit"].button-primary:focus, 
input[type="reset"].button-primary:focus, 
input[type="button"].button-primary:focus { 
    color: #000; 
    background-color: #fff; 
    border-color: #407F7F; 
} 


/* Forms 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
input[type="email"], 
input[type="number"], 
input[type="search"], 
input[type="text"], 
input[type="tel"], 
input[type="url"], 
input[type="password"], 
textarea, 
select { 
    height: 38px; 
    padding: 6px 10px; /* The 6px vertically centers text on FF, ignored by Webkit */ 
    background-color: #fff; 
    border: 1px solid #D1D1D1; 
    border-radius: 4px; 
    box-shadow: none; 
    box-sizing: border-box; 
    font-size: 1em; 
} 
/* Removes awkward default styles on some inputs for iOS */ 
input[type="email"], 
input[type="number"], 
input[type="search"], 
input[type="text"], 
input[type="tel"], 
input[type="url"], 
input[type="password"], 
textarea { 
    -webkit-appearance: none; 
    -moz-appearance: none; 
      appearance: none; 
} 
textarea { 
    min-height: 65px; 
    padding-top: 6px; 
    padding-bottom: 6px; 
} 
input[type="email"]:focus, 
input[type="number"]:focus, 
input[type="search"]:focus, 
input[type="text"]:focus, 
input[type="tel"]:focus, 
input[type="url"]:focus, 
input[type="password"]:focus, 
textarea:focus, 
select:focus { 
    border: 1px solid #33C3F0; 
    outline: 0; 
} 
label, 
legend { 
    display: block; 
    margin-bottom: .5rem; 
    font-weight: 600; 
} 
fieldset { 
    padding: 0; 
    border-width: 0; 
} 
input[type="checkbox"], 
input[type="radio"] { 
    display: inline; 
} 
label > .label-body { 
    display: inline-block; 
    margin-left: .5rem; 
    font-weight: normal; 
} 
input + label { 
    margin-top: .5rem; 
} 


/* Lists 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 


/* Code 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 

/* Tables 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
th, 
td { 
    padding: 12px 15px; 
    text-align: left; 
    border-bottom: 1px solid #E1E1E1; 
} 
th:first-child, 
td:first-child { 
    padding-left: 0; 
} 
th:last-child, 
td:last-child { 
    padding-right: 0; 
} 



/* Flow Blocks 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 

.image-block img { 
    max-width: 100%; 
    height: auto; 
} 

.text-block-centered { 
    text-align: center; 
} 


@media (min-width: 550px) { 
    .pullquote-block-left { 
    width: 50%; 
    text-align: center; 
    float: left; 
    } 
    .pullquote-block-left blockquote { 
    border-left: none; 
    margin-left: 0; 
    padding-left: 0; 
    margin-right: 1em; 
    padding-right: 1em; 
    border-right: 2px solid #407F7F;  
    } 

    .pullquote-block-right { 
    width: 50%; 
    text-align: center; 
    float: right; 
    } 
} 



/* Custom Layout 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 

* { 
    margin: 0; 
} 

* + * { 
    margin-top: 1em; 
} 

main { 
    background-color: white; 
    padding-bottom: 0; 
} 

body, br, dt, dd, th, td, option { 
    margin-top: 0; 
} 

header, footer { 
    max-width: none; 
} 

header { 
    background: url("/assets/images/sprouts-green-splash-triangles-compressed.jpg?v=1") no-repeat center; 
    background-image: url("/assets/images/sprouts-green-splash-triangles.svg?v=1"); 
    background-size: contain; 

    background-position: center top; 
    background-repeat: no-repeat; 
    background-size: cover; 
    padding: 10vw 2rem; 
    text-align: center; 
    padding-bottom: 2rem; 
} 

header img { 
    max-width: 100%; 
} 

figure { 
    margin: 1em 0; 
} 
figure img { 
    display: block; 
    margin: 0 auto; 
} 
figcaption { 
    text-align: center; 
} 

nav a { 
    border: 1px solid #669999; 
    border-radius: 290486px; 
    color: #D5E1A7; 
    background: rgba(0,0,0,0.7); 
    letter-spacing: 0.2em; 
    padding: 10px 10px; 
    margin: 0.5em; 
    text-transform: uppercase; 
    text-decoration: none; 
    transition: none 200ms ease-out; 
    transition-property: color, background; 
} 

nav a:hover, nav a.active { 
    background: #407F7F; 
    color: white; 
} 

nav li { 
    display: inline-block; 
    margin-top: 1.5em; 
} 

footer { 
    margin: 0 auto; 
    color: #92B52F; 
} 
footer p { 
    text-align: center; 
} 

.heading-block { 
    background: url("/assets/images/leaves-green-70p.jpg") no-repeat center; 
    background-image: url("/assets/images/leaves-green-70p.svg"); 
    background-size: contain; 

    background-position: center top; 
    background-repeat: no-repeat; 
    background-size: cover; 
} 

.summary-block { 
    background: url("/assets/images/leaves-yellow-70p.jpg") no-repeat center; 
    background-image: url("/assets/images/leaves-yellow-70p.svg"); 
    background-size: contain; 

    background-position: center top; 
    background-repeat: no-repeat; 
    background-size: cover; 

    padding-bottom: 2em; 

    font-size: 1.2rem; 
} 

h1 { 
    font-size: 1.8rem; 
} 

/* Grid 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
.flow-block { 
    position: relative; 
    box-sizing: border-box; 
    margin-top: 0; 
    padding-top: 2em; 
    padding-bottom: 2em; 
} 
.flow-block.heading-block, .flow-block.summary-block { 
    padding: 0; 
} 
.heading-block + .flow-block, .summary-block + .flow-block { 
    padding-top: 0; 
} 
.heading-block h1 { 
    margin: 0; 
} 
.container { 
    margin: 0; 
    padding: 1em 1em; 
} 

/* Larger than phablet (also point when grid becomes active) */ 
@media (min-width: 550px) { 
    .container { 
    max-width: 30em; 
    margin: 0 auto; 
    } 
} 

/* Pop-ups 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
#popup-background { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: #000; 
    opacity: 0.3; 
    z-index: 10001; 
} 
.popup { 
    display: none; 
    position: fixed; 
    left: 50%; 
    top: 50%; 
    transform: translateX(-50%) translateY(-50%); 
    -webkit-transform: translateX(-50%) translateY(-50%); 
    -ms-transform: translateX(-50%) translateY(-50%); 
    background-color: #fff; 
    box-shadow: 0px 1px 4px 0 rgba(0, 0, 0, 0.5); 
    z-index: 10002; 
} 
.popup-content { 
    padding: 1rem; 
} 
#popup-close { 
    position: absolute; 
    left: 100%; 
    margin: -8px 0 0 -12px; 
    width: 20px; 
    height: 20px; 
    color: #fff; 
    font-size: 12px; 
    font-weight: bold; 
    text-align: center; 
    border-radius: 50%; 
    border: 1px solid #ddd; 
    background-color: #5c5c5c; 
    cursor: pointer; 
} 


/* Media Queries 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
/* 
Note: The best way to structure the use of media queries is to create the queries 
near the relevant code. For example, if you wanted to change the styles for buttons 
on small devices, paste the mobile query code up in the buttons section and style it 
there. 
*/ 


/* Larger than mobile */ 
@media (min-width: 400px) {} 

/* Larger than phablet (also point when grid becomes active) */ 
@media (min-width: 550px) {} 

/* Larger than tablet */ 
@media (min-width: 750px) {} 

/* Larger than desktop */ 
@media (min-width: 1000px) {} 

/* Larger than Desktop HD */ 
@media (min-width: 1200px) {} 


/* Spacing 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 


/* Utilities 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
/* Make element full width */ 
.u-full-width { 
    width: 100%; 
    box-sizing: border-box; } 

/* Make sure elements don't run outside containers (great for images in columns) */ 
.u-max-full-width { 
    max-width: 100%; 
    box-sizing: border-box; } 

/* Float either direction */ 
.u-pull-right { 
    float: right; } 
.u-pull-left { 
    float: left; } 

/* Clear a float */ 
.u-cf { 
    content: ""; 
    display: table; 
    clear: both; } 

.u-round { 
    border-radius: 50%; 
} 
.u-border { 
    border: 8px double black; 
    background-color: white; 
} 

/* Spacing helpers */ 
.u-mal { 
    margin: 1em; 
} 
.u-mtl { 
    margin-top: 1em; 
} 
.u-mrl { 
    margin-right: 1em; 
} 
.u-mbl { 
    margin-bottom: 1em; 
} 
.u-mll { 
    margin-left: 1em; 
} 

/* Misc 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 
hr { 
    margin-top: 3rem; 
    margin-bottom: 3rem; 
    border-width: 0; 
    border-top: 1px solid #2D882D; 
} 

.asterisk { 
    color: red; 
} 

#custom-search { 
    box-sizing: content-box; 
} 

/* Clearing 
–––––––––––––––––––––––––––––––––––––––––––––––––– */ 

/* Self Clearing Goodness */ 
.container:after, 
.row:after, 
.u-cf { 
    content: ""; 
    display: table; 
    clear: both; 
} 

Antwort

1

Ihr Problem stammt aus diesem in Ihrem css: td { Padding: 12px 15px;

Das Suchfeld befindet sich innerhalb eines td-Elements und wird daher extra aufgefüllt.

Vielleicht stattdessen einen engeren Wähler versuchen Sie sich mit (beispielsweise td und der Klasse paddTable)

+0

Perfect, danke! –

Verwandte Themen