Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Is it possible to have a background with gradient + background-image

Is it possible to have a background with gradient + background-image

Problem

I'm trying to add an arrow image to my link and have it positioned to the middle. My link has a Background gradient in place as well and im trying to apply a background-image on to of this applied to the right.

CSS

   #nav a.linkchildflyout:link,
    #nav a.linkchildflyout:active,
    #nav a.linkchildflyout:visited 
    {
        display:block;
        padding:0px 5px;
        text-decoration:none;
        background: #b95d73; /* Old browsers */
        background: -moz-linear-gradient(top, #b95d73 0%, #970e2e 0%, #9c1a38 0%, #910022 52%, #b95d73 100%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b95d73), color-stop(0%,#970e2e), color-stop(0%,#9c1a38), color-stop(52%,#910022), color-stop(100%,#b95d73)); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* IE10+ */
        background: linear-gradient(top, #b95d73 0%,#970e2e 0%,#9c1a38 0%,#910022 52%,#b95d73 100%); /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b95d73', endColorstr='#b95d73',GradientType=0 ); /* IE6-9 */
        color: white;
    }

    #nav a.linkchildflyout
    {
        background-image: url(Images/arrow.png);
        background-position: right center;
        background-repeat: no-repeat;
    }
Problem courtesy of: davey

Solution

Yes there css3 multiple background property. You can write like this:

#nav a.linkchildflyout{
 background:linear-gradient(top, #b95d73 0%, #970e2e 0%, #9c1a38 0%, #910022 52%, #b95d73 100%),url(Images/arrow.png) no-repeat right center;
}

Read this for more http://www.css3.info/preview/multiple-backgrounds/

Solution courtesy of: sandeep

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Is it possible to have a background with gradient + background-image

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×