Note that there are some explanatory texts on larger screens.

plurals
  1. POform button styling, font-size and box shadow problems
    primarykey
    data
    text
    <p>I'm trying to style a button in a from besides a input text field. Everyting works unless I lower the font-size of the button (which is I need to do) and give my button a background gradient. If I lower the font-size (or set anything except 1em) there is a mystical space below my button text and I have no idea where it comes from. If I raise the padding to match the lowered font-size, the space is still there. If I add a gradient to the button the box shadow of the surrounding form vanishes.</p> <p>How can I fix both?</p> <p>Here is a working example: <a href="http://jsfiddle.net/WTrQy/" rel="nofollow">http://jsfiddle.net/WTrQy/</a></p> <p>HTML:</p> <pre><code>&lt;section class="grid-100 search"&gt; &lt;header class="none"&gt; &lt;h1&gt;Schnell finden&lt;/h1&gt; &lt;/header&gt; &lt;form class="grid-90 grid-parent" action="action.php"&gt; &lt;input type="text" aria-required="true" placeholder="Suche nach PLZ oder Ort" class="grid-80 mobile-grid-80"&gt; &lt;button class="grid-20 mobile-grid-20"&gt;Suchen&lt;/button&gt; &lt;/form&gt; &lt;/section&gt; </code></pre> <p>CSS:</p> <pre><code>section.search h1 { margin-top: 1.7em; margin-bottom: .5em; font-size: 1.285714285714286em; text-transform: uppercase; } section.search form { margin-top: 1em; background-color: #353535; -webkit-border-radius: 0.3em; -moz-border-radius: 0.3em; border-radius: 0.3em; -webkit-box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.2); box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.2); } section.search form input, section.search form button { padding: 0.7em; } section.search form input { -webkit-border-radius: 0.2em 0 0 0.2em; -moz-border-radius: 0.2em 0 0 0.2em; border-radius: 0.2em 0 0 0.2em; } section.search form button { font-size: 0.7em; -webkit-border-radius: 0 0.2em 0.2em 0; -moz-border-radius: 0 0.2em 0.2em 0; border-radius: 0 0.2em 0.2em 0; background: #d60e64; background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Q2MGU2NCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM2YzA0MzciIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, #d60e64 0%, #6c0437 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d60e64), color-stop(100%, #6c0437)); background: -webkit-linear-gradient(top, #d60e64 0%, #6c0437 100%); background: -o-linear-gradient(top, #d60e64 0%, #6c0437 100%); background: -ms-linear-gradient(top, #d60e64 0%, #6c0437 100%); background: linear-gradient(to bottom, #d60e64 0%, #6c0437 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d60e64', endColorstr='#6c0437', GradientType=0); cursor: pointer; color: #fff; /*font-size: 0.7857142857142857em;*/ } section.search button:hover { background: #a4145a; background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2E0MTQ1YSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM1ODAyMmMiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, #a4145a 0%, #58022c 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #a4145a), color-stop(100%, #58022c)); background: -webkit-linear-gradient(top, #a4145a 0%, #58022c 100%); background: -o-linear-gradient(top, #a4145a 0%, #58022c 100%); background: -ms-linear-gradient(top, #a4145a 0%, #58022c 100%); background: linear-gradient(to bottom, #a4145a 0%, #58022c 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a4145a', endColorstr='#58022c', GradientType=0); } section.search form input::-webkit-input-placeholder { font-size: 0.8em; } section.search form input:-moz-placeholder { /* Firefox 18 - */ font-size: 0.8em; } section.search form input::-moz-placeholder { /* Firefox 19 + */ font-size: 0.8em; } section.search form input:-ms-input-placeholder { /* Internet Explorer 1em is by purpose */ font-size: 1em; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload