2017-02-27 1 views
0

erzeugen Hier ist der Code, den ich habe. Ich möchte die Grenze für diese radial-Gradiant und auch auf die div

div { 
 
    height: 150px; 
 
    margin: 5em 2em; 
 
    background: radial-gradient(circle at top center, transparent, transparent 70px, black 70px, black); 
 
    border-radius: 8p## Heading ##x; 
 
    position: relative; 
 
} 
 

 
.circle { 
 
    width: 120px; 
 
    height: 120px; 
 
    background: red; 
 
    border-radius: 50%; 
 
    position: absolute; 
 
    top: 0; 
 
    left: 50%; 
 
    transform: translate(-50%, -50%); 
 
} 
 

 
body { 
 
    background-image: url(http://www.fillmurray.com/1000/1000); 
 
    background-size: cover; 
 
}
<div> 
 
    <span class="circle"></span> 
 
</div> 
 

 
<!-- this creates the cut in a div placing a circle on the cut and i need to put a border for the whole div even in the cut part of div. -->

+0

können Sie klären, was Sie zu tun versuchen? –

+0

Ausgehend von dem Kommentar im Code versucht OP, einen Rahmen für das schwarz gefärbte div-Element zu erhalten. Der Rahmen muss nur auf das äußere div angewendet werden, aber auch einen Rahmen, der sich um den "Schnitt" (der den roten Bereich enthält), aber nicht über den roten Bereich erstreckt. –

Antwort

2

Meinst du so etwas wie dieses ?:

div { 
 
    height: 150px; 
 
    margin: 5em 2em; 
 
    background: radial-gradient(circle at top center, transparent, green 70px, black 70px, black); 
 
    border-radius: 8p## Heading ##x; 
 
    position: relative; 
 
    border: 10px solid green; 
 
} 
 

 
.circle { 
 
    width: 120px; 
 
    height: 120px; 
 
    background: red; 
 
    border-radius: 50%; 
 
    position: absolute; 
 
    top: 0; 
 
    left: 50%; 
 
    transform: translate(-50%, -50%); 
 
} 
 

 
body { 
 
    background-image: url(http://www.fillmurray.com/1000/1000); 
 
    background-size: cover; 
 
}
<div> 
 
    <span class="circle"></span> 
 
</div> 
 

 
<!-- this creates the cut in a div placing a circle on the cut and i need to put a border for the whole div even in the cut part of div. -->

Verwandte Themen