html - Circle/Donut shape with a piece cut-off -
how can make image 1 below pure css or canvas? need have transparent background; can me this?

something (after possibly tinkering):
html,body{background:black;} .nut{ height:200px; width:200px; border-radius:50%; position:relative; background-color:lightblue; } .nut:before{ position:absolute; content:""; height:40%; width:40%; background-color:black; left:30%; top:30%; border-radius:50%; } .nut:after{ position:absolute; content:""; height:40%; width:40%; background-color:lightblue; right:-5%; bottom:-5%; border-radius: 0 0 100% 0; border-left:5px solid black; border-top:5px solid black; } <div class="nut"></div> in terms of allowing transparent background, illustrate like:
div { border-radius: 50%; height: 50px; width: 50px; border: 50px solid blue; position: relative; border-bottom-color: transparent; transform: rotate(-45deg); margin: 20px auto; } div:after { content: ""; position: absolute; top: -50px; left: -50px; height: 100%; width: 100%; border-radius: 50%; border: 50px solid transparent; border-bottom-color: blue; transition: 0.6s; } div:before { content: ""; position: absolute; top: -10px; left: -10px; height: 100%; width: 100%; border: 10px solid blue; border-radius: 50%; } div:hover:after { top: -30px; left: -50px; border-bottom-color: tomato; } /*demo only*/ html { text-align: center; height: 100%; background: radial-gradient(ellipse @ center, rgba(79, 79, 79, 1) 0%, rgba(34, 34, 34, 1) 100%); } hover me <div></div>
Comments
Post a Comment