Grow your CSS skills. Land your dream job.

How do I make this simple effect with CSS3?

  • # July 15, 2013 at 12:39 am

    http://d36xtkk24g8jdx.cloudfront.net/bluebar/0d8ce52/images/homepage/content-background.png

    I have everything except the box-shadow doing what I want. It won’t fade like the image does.

    Is this effect even possible with CSS3?

    # July 15, 2013 at 12:57 am

    hope this is possible with css3 gradient…

    background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 25%, rgba(35,35,35,1) 100%, rgba(214,14,154,1) 100%, rgba(214,14,154,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(25%,rgba(255,255,255,1)), color-stop(100%,rgba(35,35,35,1)), color-stop(100%,rgba(214,14,154,1)), color-stop(100%,rgba(214,14,154,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(35,35,35,1) 100%,rgba(214,14,154,1) 100%,rgba(214,14,154,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(35,35,35,1) 100%,rgba(214,14,154,1) 100%,rgba(214,14,154,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(35,35,35,1) 100%,rgba(214,14,154,1) 100%,rgba(214,14,154,1) 100%); /* IE10+ */
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(35,35,35,1) 100%,rgba(214,14,154,1) 100%,rgba(214,14,154,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=’#ffffff’, endColorstr=’#d60e9a’,GradientType=0 );

    # July 15, 2013 at 12:59 am

    Im sorry, I should learn formatting the code here…. the above code is generated by photoshop like css3 gradient generator at

    http://www.colorzilla.com/gradient-editor/

    # July 15, 2013 at 1:36 am

    @sadunaresh use _<pre><code></code></pre>_

    # July 15, 2013 at 2:05 am

    @Keilowe.. thanks for the tip.. :)

    # July 15, 2013 at 5:18 am

    >Is this effect even possible with CSS3?

    As a box-shadow, I don’t think so…as I’m **pretty** sure you can’t use a gradient as a color for those. I suspect that one could fake it with a couple of pseudo elements and box-shadow but that would probably be just as much work as….

    … background gradient as described above would be the best option

    # July 15, 2013 at 5:32 am

    maybe this will be helpful http://css-tricks.com/examples/GradientBorder/

    # July 15, 2013 at 5:38 am

    I would probably go with box-shadow and pseudo-element edges from the link Kuzyo posted to handle the gradient. Would only work on solid backgrounds.

    # July 15, 2013 at 6:16 am

    you could use pseudo element and bg gradient or image , or two elements for older browser.

    http://codepen.io/gcyrillus/pen/DLsCI

    You could use border-image as well :)

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".