Forums

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

Home Forums CSS Stripped background (CSS gradients)

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #39797
    Kitty Giraudel
    Participant

    Hi guys !

    Does anyone know how to make a vertically stripped background on a rotated element ?
    There is a reduced test case : http://jsfiddle.net/YQp75/29/. Please test with latest Chrome / Firefox.

    Thanks and congratulations on the one who manage to do this, if it’s even possible. ;)

    #109882
    Paulie_D
    Member

    Obviously this isn’t possible as it stands. The gradient is doing exactly what it is supposed to but you have rotated the element.

    You would need a different gradient on the rotated element.

    #109883
    Kitty Giraudel
    Participant

    The point is I can’t figure how to deal with this different gradient.

    #109884
    Kitty Giraudel
    Participant

    Emad Elsaid (@blaz_boy) on Twitter proposed me two solutions :
    – Needs an extra element : http://jsfiddle.net/YQp75/19/
    – Uses a pseudo-element instead of the extra element : http://jsfiddle.net/YQp75/20/

    Those are nice work arounds, but in my case I can’t afford any other (pseudo-)element. I’m looking for a solution with one single element, if possible.

    #109885
    Paulie_D
    Member
    #109886
    Kitty Giraudel
    Participant

    I don’t know which browser you’re using, but it doesn’t work for me (Chrome 21 / Aurora 17 Windows XP).

    I want the background of the second div to be the same as the first one. So vertical stripes. :P

    #109887
    Kitty Giraudel
    Participant

    Mads Cordes (@mobilpadde) on Twitter tried with a -webkit-mask : http://jsfiddle.net/Mobilpadde/D7dEf/3/. It works, but it’s -webkit- only, so not efficient enough.

    Sandy Jackiewicz (@SandyEJack) on Twitter tried with an image encoded base64, via Patternify. I dug into it and the best I could do is : http://jsfiddle.net/ZumRs/. Not great.

    #109888
    Paulie_D
    Member

    Weird…I had it working but it’s gone wonky.

    #109889
    Kitty Giraudel
    Participant

    Finally found the solution : http://jsfiddle.net/YQp75/32/.

    #109894
    Paulie_D
    Member

    Nice

    #109895
    Kitty Giraudel
    Participant

    Thanks. Was tough.

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