html - Transparent border radius outside -
i need help, have div border-radius , need transparent outside circle div. tried :after , outline. ":after" border stayed within div , outline couldn't rounded.
does know answer ?
css :
div.circle { background: black; width: 5em; height: 5em; -moz-border-radius: 2.5em; -webkit-border-radius: 2.5em; border-radius: 2.5em; } div.circle p { padding: 2em 2em 0 2em; color: white; } div.circle:after { content:''; display: block; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: 2.5em; border: 4px solid rgba(255, 255, 255, 0.51); } css outline property:
div.circle { outline: 4px solid rgba(255,255,255,0.3); background: black; width: 5em; height: 5em; -moz-border-radius: 2.5em; -webkit-border-radius: 2.5em; border-radius: 2.5em; } what want: http://giovannigras.be/home/img.png
use box-shadow instead of border:
box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.51); cause transparent border transpare background beneath,
while if use spread value in box-shadow property you're go:
also suggested @vals can go background-clip retain background size content-box size model cause otherwise goes default border-box.
docs:
https://developer.mozilla.org/en-us/docs/web/css/box-shadow
https://developer.mozilla.org/en-us/docs/web/css/background-clip
Comments
Post a Comment