0

I'm trying to make the border of a div have a gradient as seen here, under the 'Gradient' heading.

enter image description here

I've put the code shown on this site into a jsfiddle, here, but as you can see, it doesn't work.

.border_gradient {
    border: 8px solid #000;
    -moz-border-bottom-colors:#897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-top-colors:  #897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-left-colors: #897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-right-colors:#897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    padding: 5px 5px 5px 15px;
    width: 300px;
}

Can anyone point me in the right direction for how to accomplish such a gradient? Thanks in advance.

3
  • It works on the latest FireFox but not on the latest Chrome or IE 10. Commented Dec 22, 2013 at 3:14
  • 1
    This might help: stackoverflow.com/a/6441510/1090389 Commented Dec 22, 2013 at 3:28
  • Your using -moz- prefixed properties. These only work in Firefox. Commented Dec 22, 2013 at 4:20

2 Answers 2

0

As suggested by codehorse, using box shadow inset accomplishes what I'm looking for, and with much less code at that. Thanks guys!

Sign up to request clarification or add additional context in comments.

Comments

0

This css declaration will only work under mozilla browser

.border_gradient {
    border: 8px solid #000;
    -moz-border-bottom-colors: #897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-top-colors:    #897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-left-colors:   #897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
    -moz-border-right-colors:  #897048 #917953 #a18a66 #b6a488 #c5b59b #d4c5ae #e2d6c4 #eae1d2;
}

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.