How Can you set a border opacity in CSS?

First and foremost, create a container div, having a border div and then the content div. No, there is no way to only change the opacity of the border by simply using rgba() .The best way to make the border semi-transparent is with the rgba color format. For example, this would give a red border with 50% opacity:

div {
    border: 1px solid rgba(255, 0, 0, .5);
    -webkit-background-clip: padding-box; /* for Safari */
    background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */