Custom Borders in CSS

I am trying to give a background-image to a border but it does not work. Is it possible to give a background-image to a border?