How to make not fully rounded circle? - html

I want to do rounded circle like below image
But I am in trouble in making inner rounded one ! I tried with border-top-style & border-right-style but not getting the same yet .
.circle {
border-radius:50%;
width:100px;
height:100px;
background:#A2D36E;
text-align:center; }
.bar {
top:15px;
left:15px;
border-radius:50%;
border:1px solid white;
border-width:3px;
border-top-style:none;
border-right-style:none;
width:80px;
height:80px;
position:absolute;
}
span {
top:30%;
transform:translateY(-30%);
position:relative;
font-size:1.6rem;
color:#fff;
font-weight:bold;
}
<div class='circle'>
<div class='bar'> </div>
<span>8.8</span>
</div>

.circle {
border-radius:50%;
width:100px;
height:100px;
background:#A2D36E;
text-align:center; }
.bar {
top:15px;
left:15px;
border-radius:50%;
border:1px solid white;
border-width:3px;
border-top-style:inset;
border-right-style:inset;
border-top-color: transparent;
width:80px;
height:80px;
position:absolute;
transform: rotate(40deg);
}
span {
top:30%;
transform:translateY(-30%);
position:relative;
font-size:1.6rem;
color:#fff;
font-weight:bold;
}
<div class='circle'>
<div class='bar'> </div>
<span>8.8</span>
</div>

Try This:
.circle {
border-radius:50%;
width:100px;
height:100px;
background:#A2D36E;
text-align:center;
}
.bar {
top:15px;
left:15px;
border-radius:50%;
border:1px solid white;
border-width:3px;
width:80px;
height:80px;
position:absolute;
}
.bar:after {
width: 25px;
height: 10px;
content: '';
position: absolute;
top: -3px;
background: #A2D36E;
transform: rotate(20deg);
}
span {
top:30%;
transform:translateY(-30%);
position:relative;
font-size:1.6rem;
color:#fff;
font-weight:bold;
}
<div class='circle'>
<div class='bar'> </div>
<span>8.8</span>
</div>

The CodePen link demonstrates an SVG solution: https://codepen.io/UncaughtTypeError/pen/WXRObq
The Code Snippet below demonstrates x2 solutions you could explore:
Border Shape solution
Clip Path solution
.circle {
border-radius: 50%;
width: 100px;
height: 100px;
background: #A2D36E;
text-align: center;
position: relative;
}
.bar {
top: 0;
bottom: 0;
left: 0;
right: 0;
border-radius: 50%;
border: 1px solid white;
border-width: 3px;
margin: auto;
width: 80px;
height: 80px;
position: absolute;
}
span {
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
height: 35px;
position: absolute;
font-size: 1.6rem;
color: #fff;
font-weight: bold;
}
/* Additional */
.clip-path-solution .bar:after {
content: "";
width: 90px;
height: 90px;
position: absolute;
bottom: 0;
top: -3px;
left: -3px;
right: 0;
background: #a2d36e;
border-radius: 100%;
-webkit-clip-path: polygon(48% 48%, 100% 0%, 100% 0%, 50% 0%);
clip-path: polygon(48% 48%, 100% 0%, 100% 0%, 50% 0%);
transform: rotate(10deg);
}
.border-solution .shape {
transform: rotate(-30deg);
border-top: 10px solid transparent;
border-left: 10px solid transparent;
border-bottom: 10px solid transparent;
position: absolute;
box-sizing: border-box;
/* starting point */
/*border-right: 10px solid #d36e6e;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 90px;
height: 90px;
border-radius: 100%;*/
/* adjusted accordingly for demonstration */
margin: 0;
width: 50px;
height: 50px;
top: 10px;
margin: 0;
right: 10px;
left: auto;
border-top-right-radius: 45px;
border-bottom-right-radius: 30px;
border-right: 10px solid #a2d36e;
}
<h3>Clip Path</h3>
<div class='clip-path-solution circle'>
<div class='bar'></div>
<span>8.8</span>
</div>
<h3>Border Shape</h3>
<div class='border-solution circle'>
<div class='bar'></div>
<div class='shape'></div>
<span>8.8</span>
</div>

Related

Create a div with a cross and a text inside with CSS

I'm trying to create a div with an 'x' and a text inside it, as shown on this image
Can I somehow improve this snippet?
div {
width:49px;
height:49px;
border:1px solid black;
position:relative;
text-align:center;
line-height:49px;
font-size:25px;
}
div:before {
content:'';
position:absolute;
width:0;
height:0;
top:-1px;
left:-1px;
border:25px solid transparent;
border-right:25px solid black;
border-bottom:25px solid black;
z-index:-3;
}
div:after {
position:absolute;
content:'';
width:0;
height:0;
top:1px;
left:1px;
border:24px solid transparent;
border-right:24px solid white;
border-bottom:24px solid white;
z-index:-2;
}
<div>XL</div>
The snippet above is just what I've done so far, a completely different solution(as long as the outcome is as shown on the image attached) is perfectly fine
If you want to make sure the text is always centered in the div, you could use absolute positioning and apply a background
See this fiddle
.wrapper {
width:50px;
height:50px;
border:2px solid black;
position:relative;
text-align:center;
font-size:25px;
padding: 10px;
overflow: hidden;
}
.wrapper:before {
content:'';
position:absolute;
top:50%;
left: 50%;
width:0;
height:200%;
border: 1px solid black;
transform: translateY(-50%)rotate(45deg);
z-index: -3;
}
.wrapper:after {
content:'';
position:absolute;
top:50%;
left: 50%;
width:0;
height:200%;
border: 1px solid black;
transform: translateY(-50%)rotate(-45deg);
z-index: -3;
}
.wrapper > div {
background: #fff;
padding: 5px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<div class="wrapper">
<div>
XL
</div>
</div>
Use linear-gradient()
I made two choices, inspired by the answers.
I used linear-gradient (), which is another way.
.first,
.second {
width: 49px;
height: 49px;
border: 1px solid black;
position: relative;
text-align: center;
margin: 0 auto 8px auto;
line-height: 49px;
font-size: 25px;
}
.first:before,
.second:before {
content: "";
position: absolute;
height: 142%;
top: 50%;
left: 50%;
transform: translateY(-50%) rotate(45deg);
z-index: -3;
background: linear-gradient(to top, #333, #333 25%, #eee0 25%, #eee0 75%, #333 75%);
padding: 0.5px;
}
.first:after,
.second:after {
content: "";
position: absolute;
height: 142%;
top: 50%;
left: 50%;
transform: translateY(-50%) rotate(-45deg);
z-index: -3;
background: linear-gradient(to top, #333, #333 25%, #eee0 25%, #eee0 75%, #333 75%);
padding: 0.5px;
}
.second {
width: 68px;
font-size: 20px;
}
.second:after {
height: 172%;
transform: translateY(-50%) rotate(-54deg);
}
.second:before {
height: 172%;
transform: translateY(-50%) rotate(54deg);
}
<div class="first">XL</div>
<div class="second">XL</div>
wrap your text on a span tag, add background
div {
width:49px;
height:49px;
border:1px solid black;
position:relative;
text-align:center;
line-height:49px;
font-size:25px;
}
div span{
background:#fff;
}
div:before {
content:'';
position:absolute;
width:0;
height:0;
top:-1px;
left:-1px;
border:25px solid transparent;
border-right:25px solid black;
border-bottom:25px solid black;
z-index:-3;
}
div:after {
position:absolute;
content:'';
width:0;
height:0;
top:1px;
left:1px;
border:24px solid transparent;
border-right:24px solid white;
border-bottom:24px solid white;
z-index:-2;
}
<div><span>XL</span></div>

Draw dashed border inside the custom shape using HTML & CSS

I have to code a shape(below image) in HTML
And below is the code what I tried so far:
body {
font: 13px Verdana;
}
h3 {
height: 100px;
background: #72bbab;
border-radius: 50px 10px 10px 50px;
display: flex;
margin-top: 50px;
position: relative;
line-height: 100px;
color: #ffffff;
font-size: 13px;
font-weight: normal;
}
h3 i {
width: 130px;
height: 130px;
transform: translateY(-15px);
background: #71bbab;
border-radius: 50%;
position: relative;
margin-right: 20px;
}
h3:before {
content: "";
position: absolute;
border: 1px dashed #fff;
top: 5px;
bottom: 5px;
left: 20px;
right: 2px;
border-radius: 10px;
}
h3 i:before {
content: "";
position: absolute;
top: 5px;
bottom: 5px;
left: 5px;
right: 5px;
border: 1px dashed #fff;
border-radius: 50%;
}
<h3><i></i>Text</h3>
Now the issue is I am not able to remove dashed border of circle from right side. I tried border-top:0 and border-right:0 but didn't work.
Thanks in advance
Note: Don't want to use any king of image
If you need to get the output by keeping same HTML mark-up then you have to use many pseudo selectors, CSS calc() function to calculate h2 tag width and many such properties to get output using CSS.
You have too even use position and z-index to hide circle border backside of h2 tag. And using margin you could arrange the remaining, so at one point whole diagram connects.
body {
font: 13px Verdana;
}
h3{
background:#72bbab;
width:calc(100% - 95px);
height:85px;
margin-left:95px;
margin-top:21px;
display:flex;
justify-content:flex-start;
align-items:center;
border-top-right-radius:10px;
border-bottom-right-radius:10px;
padding-left:20px;
box-sizing:border-box;
color:#fff;
}
h3 i{
width:120px;
height:120px;
background:#72bbab;
border-radius:50%;
display:inline-block;
top:2px;
left:2px;
position:absolute;
z-index:-1;
overflow:hidden;
}
h3 i:before{
content:"";
width:100px;
height:100px;
border:2px dashed #fff;
position:absolute;
top:8px;
left:8px;
border-radius:50%;
}
h3:before{
content:"";
width:calc(100% - 120px);
height:65px;
border:2px dashed #fff;
position:absolute;
right:15px;
border-top-right-radius:10px;
border-bottom-right-radius:10px;
}
h3:after{
content:"";
width:3px;
height:68px;
background:#72bbab;
position:absolute;
top:28px;
margin-left:-61px;
}
<h3><i></i>Text</h3>
See if this helps.
https://jsfiddle.net/induprakash/8ofLjqxm/
I added a higher z-index to rectangle border.
body {
font: 13px Verdana;
}
h3 {
height: 100px;
background: #72bbab;
border-radius: 50px 10px 10px 50px;
display: flex;
margin-top: 50px;
position: relative;
line-height: 100px;
color: #ffffff;
font-size: 13px;
font-weight: normal;
}
h3 i {
width: 130px;
height: 130px;
transform: translateY(-15px);
background: #71bbab;
border-radius: 50%;
position: relative;
margin-right: 20px;
}
h3:before {
content: "";
position: absolute;
border: 1px dashed #fff;
top: 5px;
bottom: 5px;
left: 105px;
z-index: 10;
right: 2px;
border-radius: 0px;
border-left: 0;
}
h3 i:before {
content: "";
position: absolute;
top: 5px;
bottom: 5px;
left: 5px;
right: 5px;
border: 1px dashed #fff;
border-radius: 50%;
border-right : 1px solid #72bbab;
}
Try this one, its running as per your image. I have tried a simple and different approach.
JSFiddle Link - https://jsfiddle.net/deepak104080/uwx873x1/
.circle {
width:130px;
height:130px;
border-radius:65px;
position:absolute;
z-index:100;
background:#71bbab;
margin:0px;
padding:0px;
}
.innercircle {
width:110px;
height:110px;
border-radius:55px;
position:absolute;
top:9px;
left:9px;
z-index:100;
background:#71bbab;
border: 1px dashed #fff;
}
.tab {
height: 100px;
position:absolute;
margin-top:15px;
margin-left:105px;
z-index:1000;
width:350px;
background:#71bbab;
border-top-right-radius:10px;
border-bottom-right-radius:10px;
}
.innertab {
height: 78px;
position:absolute;
margin-top:10px;
margin-left:0px;
z-index:1000;
width:340px;
background:#71bbab;
border-top-right-radius:10px;
border-bottom-right-radius:10px;
border-top: 1px dashed #fff;
border-bottom: 1px dashed #fff;
border-right: 1px dashed #fff;
}
<div>
<div class="circle">
<div class="innercircle">
</div>
</div>
<div class="tab">
<div class="innertab">
</div>
</div>
</div>
Use the ::after pseudo for h3 element.
h3:after {
z-index: 9999;
position:absolute;
max-width: 100%;
width: 100px;
height: 87px;
background: #71bbab;
content: '';
left: 35px;
margin-top: 6px;
}
https://jsfiddle.net/apyupfwo/

how to make shape with diagonal div?

I want to make this shape :
there supposed to be 3 div shapes like this. I built already some shape, but I want to see how this shape will fit in my website
I already built this :
codepan
css example for what i did :
.mainOuterDiv{
height:300px;
overflow:hidden;
background:#FFF;
}
.middDiv{
width:70%;
height:75px;
background-color: #0CF;
margin:0px auto;
position:relative;
margin-top:50%;
}
.innerLeft{
position: absolute;
left: -60px;
top: -20px;
width: 60px;
height: 100%;
z-index: 1;
transform: skew(180deg,215deg);
background-color: #0CF;
}
.innerRight{
position: absolute;
right: -60px;
top: -20px;
width: 60px;
height: 100%;
z-index: 1;
transform: skew(180deg,145deg);
background-color: #0CF;
}
.textDiv{
z-index:9999;
width:100%;
height:100%;
position:absolute;
background-color: #0CF;
}
is there a way to make this in css ?
Here is the responsive version with skewY i have used :pseudo elements
* {
box-sizing: border-box;
}
.container {
width: 300px;
height: 300px;
margin: 0 auto;
border: 1px solid black;
position: relative;
}
.content {
background: white;
z-index: 1;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 15px;
}
.shadow {
width: 70%;
position: absolute;
left: 50%;
height: 18%;
bottom: 18%;
background: #7092BE;
border: 1px solid black;
transform: translateX(-50%);
z-index: -1;
}
.shadow:before,
.shadow:after {
content: '';
position: absolute;
width: 30%;
background: #7092BE;
height: 100%;
bottom: -28%;
border: 1px solid black;
}
.shadow:before {
left: -30%;
transform: skewY(-23deg);
}
.shadow:after {
right: -30%;
transform: skewY(23deg);
}
.ribbon {
width: 70%;
position: absolute;
left: 50%;
height: 18%;
bottom: -1px;
background: #7092BE;
border: 1px solid black;
transform: translateX(-50%);
z-index: 1;
}
.ribbon:before,
.ribbon:after {
content: '';
position: absolute;
width: 30%;
background: #7092BE;
height: 100%;
top: -28%;
border: 1px solid black;
}
.ribbon:before {
left: -30%;
transform: skewY(23deg);
}
.ribbon:after {
right: -30%;
transform: skewY(-23deg);
}
hr {
margin: 20px;
0
}
<div class="container">
<div class="content">
Nullam dictum felis eu pede
</div>
<div class="shadow"></div>
<div class="ribbon"></div>
</div>
<hr>
<div class="container" style="width:200px; height:200px;">
<div class="content">
Nullam dictum felis eu pede
</div>
<div class="shadow"></div>
<div class="ribbon"></div>
</div>
There is some example :
.container
{
position:relative;
width:400px; height:302px;
overflow:hidden;
}
.mainDiv
{
height:300px; width:300px;
background-color:white;
border:solid 1px black;
position:absolute;
left:0;right:0;margin:auto;
}
.middDiv
{
height:55px; width:70%;
background-color:lightblue;
position:absolute;
bottom:0;left:0;right:0;
margin:auto;
z-index:10;
}
.leftDiv, .rightDiv
{
position:absolute;
bottom:26px;
width:30%;height:48px;
background-color:blue;
z-index:10;
}
.leftDiv
{
left:-13%;
transform:rotate(30deg) skew(30deg);
}
.rightDiv
{
right:-13%;
transform:rotate(-30deg) skew(-30deg);
}
.leftBDiv, .rightBDiv
{
position:absolute;
width:13%; height:47px;
bottom:59px;
background-color:black;
z-index:9;
}
.leftBDiv
{
left:-12%;
transform:rotate(-30deg) skew(-30deg);
}
.rightBDiv
{
right:-12%;
transform:rotate(30deg) skew(30deg);
}
<div class="container">
<div class="mainDiv">
<div class="middDiv"></div>
<div class="leftDiv"></div>
<div class="rightDiv"></div>
<div class="leftBDiv"></div>
<div class="rightBDiv"></div>
</div>
</div>
I use different colors for middle, left and right blocks so You can see it.
If You will use border for those divs, You have to change positions: left, right and bottom for all of them.
There is fiddle example, too.

create a css format with socil media icon [duplicate]

I'm trying to draw a line using CSS and show text/image in the middle of the line.
.featured-images {
color: #666666;
border: 2px solid #333333;
}
<p class="featured-images">Featured</p>
This is what I want to do:
and
Wrap the text inside a span and use a :pseudo-element for the line.
Position the line(:pseudo-element) behind the span using z-index: -1, so that you could move around the text without having to worry about the line.
.featured-images {
position: relative;
color: #666666;
border: 2px solid #333333;
padding: 0 10px 0 30px;
}
.featured-images span {
color: #666666;
background: white;
padding: 0 10px;
}
.featured-images:after {
content: '';
position: absolute;
width: 100%;
height: 2px;
background: #666666;
left: 0;
top: 50%;
transform: translateY(-50%);
z-index: -1;
}
<p class="featured-images"><span>Featured</span></p>
Replicating the following:
You could use repeating-linear-gradient to do this.
body {
background: #E7EAE3;
}
.featured-images {
position: relative;
color: #666666;
padding: 0 10px 0 30px;
overflow: hidden;
}
.featured-images span {
color: #517575;
background: white;
padding: 0 10px;
}
.featured-images:after {
content: '';
position: absolute;
width: 120%;
height: 100%;
background: -webkit-repeating-linear-gradient(180deg, #463A3A 10px, #F2F2F2 10px, #F2F2F2 11px, #463A3A 11px, #463A3A 20px) repeat-x;
background: -moz-repeating-linear-gradient(180deg, #463A3A 10px, #F2F2F2 10px, #F2F2F2 11px, #463A3A 11px, #463A3A 20px) repeat-x;
background-size: 10px 31px;
margin-left: -30px;
transform: skew(-45deg);
left: 0;
z-index: -1;
}
<p class="featured-images"><span>Featured</span>
</p>
Using image instead of text.
.featured-images {
position: relative;
color: #666666;
border: 2px solid #333333;
padding: 0 10px 0 30px;
}
.featured-images span {
display: block;
width: 80px;
height: 13px;
background: url(http://lorempixel.com/80/13) no-repeat white 10px 0;
padding: 0 10px;
}
.featured-images:after {
content: '';
position: absolute;
width: 100%;
height: 2px;
background: #666666;
left: 0;
top: 50%;
transform: translateY(-50%);
z-index: -1;
}
<p class="featured-images"><span></span></p>
Something like this? JSFiddle
CSS:
.featured-images {
color: #666666;
}
p span {
margin:0;padding: 0 10px;
background: #FFFFFF;
display: inline-block;
}
p {
padding-left: 20px;
position: relative;
z-index: 2;
}
p:after {
content: "";
position: absolute;
top: 50%;
left: 0;
right: 0;
border-top: solid 1px #666666;
z-index: -1;
}
Demo 1
:root{padding: 40px}
p{
position: relative;
margin:40px auto;padding:0 10px;
background:white;
display:inline-block;
}
p:before,p:after{
content:"";
position:absolute;
z-index:-1;
right:0
}
p:before{
top:-4px;
left: -24px;
height: 24px;
width: 480px;
border:solid 1px #666666
}
p:after{
top: 50%;
width: 466px;
left: -16px;
border-top: solid 1px #666666
}
<p class="featured-images">Featured</p>
Use Pseudo element
:root{padding: 40px}
p{
position: relative;
margin:40px auto;padding:0 10px;
background:white;
display:inline-block;
}
p:before,p:after{
content:"";
position:absolute;
z-index:-1;
left:-14px;
right:0;
width: 480px
}
p:before{
top:-4px;
height: 24px;
border:solid 1px #666666
}
p:after{
top:50%;
border-top:solid 1px #666666
}
<p class="featured-images">Featured</p>
Demo 2
p{
position: relative;
margin:0;padding:0 10px;
background:white;
display:inline-block;
}
p:after{
content:"";
position:absolute;
top:50%;
left:-14px;
right:0;
width: 100vw;
border-top:solid 1px #666666;
z-index:-1;
}
<p class="featured-images">Featured</p>
Update
:root{padding: 40px}
p{
position: relative;
margin:40px auto;padding:0 10px;
background:white;
display:inline-block;
}
p:before,p:after{
content:"";
position:absolute;
z-index:-1;
right:0
}
p:before{
top:-4px;
left: -24px;
height: 24px;
width: 480px;
border:solid 1px #666666;
background-color: gray;
background-image: repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255,255,255,.5) 2px, rgba(255,255,255,.5) 6px)
}
}
p:after{
top: 50%;
width: 466px;
left: -16px;
border-top: solid 1px #666666
}
<p class="featured-images">Featured</p>
Result http://jsfiddle.net/p8jdzqvL/embedded/result/
<div style="height: 2px; background-color: black; text-align: center">
<span style="background-color: white; position: relative; top: -0.5em;">
Stay Connected
</span>
</div>

Lemon shape (CSS and HTML)

This is the shape I want. Can it be done with CSS?
I have created a circle. Here :
(source: pngimg.com)
<div class="lemon"></div>
CSS :-
.lemon {
width: 200px;
height: 200px;
background-color: #FFFA40;
border: 4px solid #FFF150;
border-radius: 100px;
top:20px;
}
lemon and leaves
body {
background: rgb(48, 52, 52)
}
.container {
margin: 0 auto;
width: 200px;
position: relative;
}
.leaves {
width: 7px;
height: 70px;
background: #339B00;
border-radius: 0 0 10px 10px;
position: absolute;
left: 50%;
margin-left: -4px;
z-index: 1;
}
.leaves:after {
content: '';
width: 80px;
height: 80px;
background: #339B00;
position: absolute;
border-radius: 0% 50%;
transform: rotate(96deg) skew(21deg, 11deg);
transform-origin: left top;
top: 32px;
}
.leaves:before {
content: '';
width: 70px;
left: 8px;
height: 70px;
background: #339B00;
position: absolute;
border-radius: 0% 50%;
transform: rotate(-16deg) skew(21deg, 11deg);
transform-origin: left top;
top: 32px;
}
.lemon {
width: 160px;
height: 160px;
border-radius: 50%;
background: yellow;
position: absolute;
transform: rotate(48deg) skew(6deg, 6deg);
top: 69px;
left: 50%;
margin-left: -80px;
}
.lemon:after {
content: '';
width: 50px;
height: 50px;
background: yellow;
top: 64%;
left: 50%;
position: absolute;
margin-left: 24px;
border-radius: 19px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
<div class="container">
<div class="leaves"></div>
<div class="lemon"></div>
</div>
You should use different border radii for different corners. Also, add transform: rotate(45deg); to rotate it by 45deg.
.lemon {
width: 200px;
height: 200px;
background-color: #FFFA40;
border: 4px solid #FFF150;
border-radius: 20px 140px 40px 140px; /* top right bottom left */
transform:rotate(45deg);
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
position:relative;
top:30px;
}
<div class="lemon"></div>
Bonus
A lemon with twig and leaf.
body {
background-color:#333;
}
.lemon {
width: 200px;
height: 200px;
background-color: #FFFA40;
border: 4px solid #FFF150;
border-radius: 20px 140px 40px 140px;
transform:rotate(45deg);
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
position:relative;
top:145px;
z-index:1;
}
.leaf {
width: 100px;
height: 100px;
background: #11AA11;
border-radius: 5px 100px;
transform:rotate(105deg);
-webkit-transform:rotate(105deg);
-moz-transform:rotate(105deg);
position:relative;
top:-200px;
left:110px;
z-index:3;
}
.twig{
width: 7px;
height: 0px;
border-bottom: 90px solid #A0522D;
border-left: 2px solid transparent;
border-right: 2px solid transparent;
border-bottom-right-radius:4px;
border-bottom-left-radius:4px;
transform:rotate(-10deg);
position:relative;
top:-284px;
left:88px;
z-index:2;
}
<div class="lemon"></div>
<div class="leaf"></div>
<div class="twig"></div>
This is pretty trivial with a pseudo-element for the bottom edge:
.lemon {
background:yellow;
width:200px;
height:150px;
border-radius:50%;
position:relative;
}
.lemon:after {
content:'';
position:absolute;
left:85%;
top:40%;
background:yellow;
width:25%;
height:20%;
border-radius:50%;
}
Sample fiddle here. Obviously you can rotate it to any position you want, ie. transform:rotate(90deg).