0

I have a dotted border with a color code #664914. I would like to have this border fade with a black gradient towards the end. The current css is as below:

#div1{width:1000px;border-bottom:1px dotted #664914; margin: 5px auto 0;}

Is what am trying to achieve possible to achieve with css? If so how can i achieve this. I know my question could be quite obvious but am having a hard time trying to figure it out.

roykasa
  • 2,907
  • 6
  • 28
  • 29

1 Answers1

0

You can with border-image, here's a good set of examples:

http://css-tricks.com/examples/GradientBorder/

The basic idea:

.top-to-bottom {
    border-width:3px;
    -webkit-border-image: 
        -webkit-gradient(linear, 0 0, 0 100%, from(black), to(rgba(0, 0, 0, 0))) 1 100%;
    -webkit-border-image: 
        -webkit-linear-gradient(black, rgba(0, 0, 0, 0)) 1 100%;
    -o-border-image:
        -o-linear-gradient(black, rgba(0, 0, 0, 0)) 1 100%;
    -moz-border-image:
       -moz-linear-gradient(black, rgba(0, 0, 0, 0)) 1 100%;    
}

Keep in mind, this isn't supported in IE - http://caniuse.com/#search=border-image

Fluidbyte
  • 5,162
  • 9
  • 47
  • 76