Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Gradient with png fallback

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42993
    octopus
    Participant

    If you have a look at this codepen: http://codepen.io/SiteOctopus/pen/qvDdi, you’ll see a nice background. This is done with gradients, which some browsers don’t support, is there a way to have a PNG fallback?

    Thanks in advance!

    #126172
    Paulie_D
    Member

    With a repeating bg image…sure!

    Frankly, unless it’s super important that they see your gradient/image…just served up a neutral bg color.

    It’s not as though they will know the difference.

    #126175
    octopus
    Participant

    What I’m wondering is how to actually write a bit of css that will show a colour instead

    #126186
    Paulie_D
    Member

    background:red;

    #126189
    octopus
    Participant

    Yes but how would I show that only if the background can’t be displayed?

    #126185
    Paulie_D
    Member

    Put it before all of you other background declarations.

    If the browser can’t support gradient declarations it will ignore them.

    #126190
    octopus
    Participant

    Oh, okay thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.