I’m using CSS :before and :after to add dotted line visual elements to a div:

But it seems to be interfering with the ‘edit’ button elements. (the edit button won’t respond to any onClick or MouseOver or Hover events while the parent div’s :before and :after CSS are there) Any ideas how to render the button element ‘in front of’ the :before and :after elements, aside from Z-index?
CSS:
.window_header{
width:600px;
height:42px;
background: #333 url("../img/bg-2.png") repeat;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
border-bottom:1px dotted #666;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3),inset 0 -4px 5px rgba(0, 0, 0, 0.2),inset 1px 0px 1px rgba(0, 0, 0, 0.7),inset -1px 0px 1px rgba(0, 0, 0, 0.7),inset 0 -2px 1px rgba(0, 0, 0, 0.5),inset 0 2px 6px rgba(255, 255, 255, 0.15),inset -2px 0 6px rgba(255, 255, 255, 0.15),inset 2px 0 6px rgba(255, 255, 255, 0.15);
}
.window_header:before,
.window_header:after{
content: "";
position: absolute;
top: 0;
right: 0px;
bottom: 562px;
left: 0px;
z-index:1;
border-bottom: 1px dashed #666;
background:-webkit-gradient(radial, center center, 0, center center, 260, from(rgba(255, 255, 255, 0.05)), to(rgba(255, 255, 255, 0)));
}
.button_edit{
margin: 8px 8px 8px 8px;
border-radius:6px;
width:70px;
font-size: 9pt;
font-weight:bold;
cursor:pointer;
font-family: Helvetica, sans-serif;
text-shadow: 0px -1px 1px rgba(0,0,0,0.5);
border: 1px solid rgba(0, 0, 0, 0.5);
border-top-color: rgba(0, 0, 0, 0.496094);
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2),0 -1px 1px rgba(0, 0, 0, 0.3);
z-index:100;
}
.fl_right{
float:right;
}
HTML:
<div class="window_header">
<div class="button_edit fl_right" id="button_edit_site"> Edit </div>
</div>
I think you forgot to add
position: relativeto.button_edit.z-indexrequiresrelative/absoluteto work:http://jsfiddle.net/CB2BE/1/