Web Design Forum: CSS Background Gradient help - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CSS Background Gradient help cant get my gradient working cross browser :(

#1 User is offline   prezaeis 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 13-October 11
  • Reputation: 0
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 21 January 2012 - 06:16 AM

Hi guys,

Im trying to put a CSS gradient effect on my websites menu buttons
Now ive got it working perfectly on Firefox but can get it to show on Chrome or Safari (havent checked IE as im on a mac)

Can someone help me iv been pulling my hair out all night, the code im using is below:


background-color: #343434;
background-image: -moz-linear-gradient(center top , rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%), url("../images/nav-item-pattern.png");
background-image: -webkit-gradient(center top , rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%), url("../images/nav-item-pattern.png");

appreciated guys

This post has been edited by prezaeis: 21 January 2012 - 06:17 AM

0

#2 User is offline   simplypixie 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 23-November 11
  • Reputation: 11
  • Gender:Female
  • Location:Shropshire
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 21 January 2012 - 07:22 AM

I may be wrong but you set gradients using background: not background-image: and I am not sure why you want a gradient and an image at the same time (or if you can even do that). Plus you need to indicate what type of gradient it is.
See Here
0

#3 User is offline   prezaeis 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 13-October 11
  • Reputation: 0
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 21 January 2012 - 08:09 AM

View Postsimplypixie, on 21 January 2012 - 07:22 AM, said:

I may be wrong but you set gradients using background: not background-image: and I am not sure why you want a gradient and an image at the same time (or if you can even do that). Plus you need to indicate what type of gradient it is.
See Here


the image im laying on top is just a transparent png file
its sort of a dusty texture, makes the buttons that little bit more shiny and funky!

thing is my code works perfectly in firefox, so just need to see what needs doing for other browsers
0

#4 User is offline   dansk 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 14
  • Joined: 15-June 08
  • Reputation: 0
  • Location:South London
  • Experience:Beginner
  • Area of Expertise:Designer/Coder

Posted 21 January 2012 - 10:22 AM

Try this:

#dustybutton { 
    background: url('../images/nav-item-pattern.png') no-repeat 0 0, rgb(30,87,153);
    background: url('../images/nav-item-pattern.png') no-repeat 0 0, 
                -moz-linear-gradient(center top , rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    background: url('../images/nav-item-pattern.png') no-repeat 0 0, 
                -webkit-gradient(center top , rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
}


I've not tested it mind.. but if it doesn't work, you could try the older webkit format using color stops.
0

#5 User is offline   prezaeis 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 13-October 11
  • Reputation: 0
  • Gender:Male
  • Location:London
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 25 January 2012 - 01:31 AM

thank you, finally went with this which worked, the above example didnt work :(

background-color: #343434;
    background: -moz-linear-gradient(top,  rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
    background: linear-gradient(top,  rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1affffff', endColorstr='#00ffffff',GradientType=0 ); /* IE6-9 */

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users