The end result should look like this: Button Comp
My button, with the image deleted, correctly displays my radial gradient perfectly (fills up the container completely). Once I add the image to the HTML, my gradient gets lost.
The image only takes up about 135px (from the top) leaving about 70px at the bottom of the container. I want the gradient to show inside this 70px area. For some reason, this area displays as a white background.
Basically let's say I have a container that has a height of 500px and is filled completely with a radial gradient. I place an image and position it center, top. the image has a height of 250px. The container should display the image in the upper half and the gradient in the lower half. Is this far fetched or what?
NOTE: With these classes below, the .sm and .lg are only in place to change the button size based on the number of buttons on my page.
Here's my button HTML:
`<a href="#"><div class="imgButton <?php echo $buttonSizeClass; ?>" style="background:transparent url(<?php echo $answer["image"]; ?>) no-repeat; background-size: 100% auto;"><label><input type="checkbox" value="<?php echo implode(",",$answer["keys"]); ?>" /><?php echo $answer["label"]; ?></label></div></a>`
Here's my CSS:
`.expert-advice .imgButton input[type=checkbox] {display:none;}
.expert-advice .imgButton {
background-size: cover;
background-origin: content-box;
background-position: top left;
-webkit-background-size: cover;
-moz-background-size: cover;
background-color: transparent !important;
border:1px solid #e3e3e3;
text-align: center;
color:#ff6600;
display:inline-block;
position: relative;
overflow: hidden;
margin-right: 15px;
}
.expert-advice .imgButton.sm {
width: 106px;
height: 98px;
-moz-border-radius:9px;
-webkit-border-radius:9px;
border-radius:9px;
font-size:.8em !important;
}
.expert-advice .imgButton.lg {
width: 205px;
height: 188px;
-moz-border-radius:18px;
-webkit-border-radius:18px;
border-radius:18px;
font-size:1.0em !important;
}
.expert-advice .imgButton label {
width: 100%;
height:auto;
position: absolute;
display:block;
top:80%;
}
.expert-advice .imgButton:hover {
background-color: #fcf1cc;
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMzAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Y5YzYzNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9yYWRpYWxHcmFkaWVudD4KICA8cmVjdCB4PSItNTAiIHk9Ii01MCIgd2lkdGg9IjEwMSIgaGVpZ2h0PSIxMDEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-radial-gradient(center, ellipse cover, #ffffff 30%, #f9c636 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(30%,#ffffff), color-stop(100%,#f9c636)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 30%,#f9c636 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #ffffff 30%,#f9c636 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #ffffff 30%,#f9c636 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #ffffff 30%,#f9c636 100%); /* W3C */
-moz-box-shadow: 0px 1px 18px -8px #000000;
-webkit-box-shadow: 0px 1px 18px -8px #000000;
box-shadow: 0px 1px 18px -8px #000000;
border:1px solid #f8bf1f;
}`