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.

mpataki14
  • 208
  • 2
  • 8

2 Answers2

0

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

mpataki14
  • 208
  • 2
  • 8
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;
}
Milche Patern
  • 19,632
  • 6
  • 35
  • 52