I wanted to make smilly for my clock but I stucked with the arcs .
This question used box shadow . Can it possible with lines to make crescent shape
I searched for many question all are using almost semi-circles not stretched like arcs.
How to make arcs like this in below image with pure CSS . Any suggestion except SVG or Canvas. Thanks for the help .
Know arcs are main in image but only one example will work I will use it at other places my self and position them
#clockStyleCircle{
position: absolute;
width: 16vw;
height: 16vw;
text-align: center;
padding: 0%;
top: 28.5%;
left: 28.5%;
border-radius: 50%;
border: 3px solid black;
background-color: rgb(255, 233, 35);
}
#clockStyleEyeCircle1{
position: absolute;
width: 4vw;
height: 4vw;
top: 24%;
left: 10%;
border: 3px solid black;
border-radius: 50%;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86); /* inset 16px 0px #777, inset 16px 0px 1px 2px #777;*/
background-color: black;
}
#clockStyleEyeCircle2{
position: absolute;
width: 4vw;
height: 4vw;
top: 24%;
left: 65%;
border: 3px solid black;
border-radius: 50%;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86);
background-color: black;
}
#clockStyleSimileCircle{
position: absolute;
width: 8vw;
height: 3vw;
top: 68%;
left: 25%;
border: 3px solid rgb(36, 36, 36);
/* border-radius: 0 0 50% 50% / 0 0 100% 100%; */
border-bottom-left-radius: 100% 200%;
border-bottom-right-radius: 100% 200%;
background-color: black;
box-shadow: inset 16px 0px #777, inset 16px 0px 1px 2px #777;;
}
<div id="clockStyleCircle">
<div id="clockStyleEyeCircle1">
<div id="clockStyleEyeSmallCircle1"></div>
</div>
<div id="clockStyleEyeCircle2">
<div id="clockStyleEyeSmallCircle2"></div>
</div>
<div id="clockStyleSimileCircle"></div>
</div>
After referring to above link eyes get alright but as you can see in above snippet shape of mouth renders in shadow . So , tried some changes in below snippet you can see its not stretched and borders are hidden to make it possible . Can it possible to make arc with pure CSS .
#clockStyleCircle {
position: absolute;
width: 16vw;
height: 16vw;
text-align: center;
padding: 0%;
top: 28.5%;
left: 28.5%;
border-radius: 50%;
border: 3px solid black;
background-color: rgb(255, 233, 35);
}
#clockStyleEyeCircle1 {
position: absolute;
width: 4vw;
height: 4vw;
top: 24%;
left: 10%;
border: 3px solid black;
border-radius: 50%;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86);
/* inset 16px 0px #777, inset 16px 0px 1px 2px #777;*/
background-color: black;
}
#clockStyleEyeCircle2 {
position: absolute;
width: 4vw;
height: 4vw;
top: 24%;
left: 65%;
border: 3px solid black;
border-radius: 50%;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86);
background-color: black;
}
#clockStyleSimileCircle {
position: absolute;
width: 6vw;
height: 6vw;
top: 45%;
left: 30%;
border: 3px solid transparent;
border-radius: 150px;
/* border-radius: 0 0 50% 50% / 0 0 100% 100%; */
/* border-bottom-left-radius: 100% 200%; */
/* border-bottom-right-radius: 100% 200%; */
background-color: transparent;
box-shadow: inset 0px -9px 1px -2px #777;
}
#clockStyleSmileSmallCircle2 {
position: absolute;
width: 1vw;
height: 2vw;
top: 76%;
left: 30%;
border: 3px solid transparent;
border-radius: 150px;
/* border-radius: 0 0 50% 50% / 0 0 100% 100%; */
/* border-bottom-left-radius: 100% 200%; */
/* border-bottom-right-radius: 100% 200%; */
background-color: transparent;
box-shadow: inset 0px 9px 1px -3px red;
}
<div id="clockStyleCircle">
<div id="clockStyleEyeCircle1">
<div id="clockStyleEyeSmallCircle1"></div>
</div>
<div id="clockStyleEyeCircle2">
<div id="clockStyleEyeSmallCircle2"></div>
</div>
<div id="clockStyleSimileCircle"><div id="clockStyleSmileSmallCircle2"></div></div>
</div>
The width and height of your smile circle is the same, so when you do border-radius it gives you a semi-circle instead of an arc, try increasing the width greater than the height and you should be able to achieve the desired result.
#clockStyleSimileCircle {
width: 7vw;
height: 6vw;
}
Related
I'm having trouble putting height variant sizes according to the number of balloons in my div.
They are following a fixed height and are not changing size according to the text, I can't put the first balloon as a height smaller than the first balloon, I already tried for a negative margin that didn't work either.
//the html below is rendered by javascript
div#chat-panel-casca {
z-index: 9999;
position: fixed;
overflow: hidden;
margin: 0;
width: 500px;
opacity: 1;
border-radius: 0;
transition-delay: .6s;
transition: .7s;
top: 0;
right: 0;
}
div #chat-casca {
height: 100vh;
background-color: #F4F4F6;
position: fixed;
top: 50px;
right: 0;
width: 499px;
}
/*this stretch corresponds to a tail applied to the first balloon*/
div #chat-casca #tail {
width: 0;
height: 0;
border-width: 0 17.5px 19px 17.5px;
border-color: transparent transparent #FFFFFF transparent;
border-style: solid;
filter: drop-shadow(-6px 2px 2px rgba(166, 166, 166, 0.24));
transform: rotate(48deg);
position: relative;
border-radius: 25px;
top: -32px;
right: 19px;
}
div #chat-casca .chat-box {
border-radius: 10px;
width: 323px;
background-color: white;
position: relative;
margin-top: 12px;
left: 45px;
box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
-webkit-box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
-moz-box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
}
/*This is my main css, it is the balloon composition*/
div #chat-casca .chat-box p {
padding-left: 20px;
padding-top: 10px;
position: relative;
}
div #chat-casca .chat-box .chat-time {
position: relative;
color: #4d4e53;
font-size: 9px;
font-stretch: condensed;
top: -25px;
padding-left: 293px;
}
<div id="chat-panel-casca">
<div id="chat-casca">
<div class="chat-box">
<p>Hy, i ame here</p>
<div id="tail"></div>
<small class="chat-time">9:6</small>
</div>
<div class="chat-box">
<p>Some text</p>
<p> Another text.</p>
<small class="chat-time">9:6</small>
</div>
</div>
</div>
My goal is to decrease the margin-botton of the first div of the example below and set the spacing of the following divs keeping the height proportion.
I have this result:
But I need this result
You can fix it just by changing your CSS.
Remove vertical margins from p inside .chat-box
Remove position:relative from .chat-time
Style #tail with absolute positioning
Add some padding-bottom to .chat-box
body {
background: #eee;
}
div#chat-panel-casca {
z-index: 9999;
position: fixed;
overflow: hidden;
margin: 0;
width: 500px;
opacity: 1;
border-radius: 0;
transition-delay: .6s;
transition: .7s;
top: 0;
right: 0;
}
div#chat-casca {
height: 100vh;
background-color: #F4F4F6;
position: fixed;
top: 50px;
left: 0;
width: 499px;
}
/*this stretch corresponds to a tail applied to the first balloon*/
div#chat-casca #tail {
width: 0;
height: 0;
border-width: 0 17.5px 19px 17.5px;
border-color: transparent transparent #FFFFFF transparent;
border-style: solid;
filter: drop-shadow(-6px 2px 2px rgba(166, 166, 166, 0.24));
transform: rotate(48deg);
position: absolute;
border-radius: 25px;
top: 0;
left: -19px;
}
div#chat-casca .chat-box {
border-radius: 10px;
width: 323px;
background-color: white;
position: relative;
margin-top: 12px;
left: 45px;
box-shadow: 0px 0px 5px 0px rgba(166,166,166,0.60);
-webkit-box-shadow: 0px 0px 5px 0px rgba(166,166,166,0.60);
-moz-box-shadow: 0px 0px 5px 0px rgba(166,166,166,0.60);
padding-bottom: 10px;
}
/*This is my main css, it is the balloon composition*/
div#chat-casca .chat-box p {
padding-left: 20px;
padding-top: 10px;
position: relative;
margin: 0;
}
div#chat-casca .chat-box .chat-time {
color: #4d4e53;
font-size: 9px;
font-stretch: condensed;
padding-left: 293px;
}
<div id="chat-casca">
<div class="chat-box">
<p>Hy, i ame here</p>
<div id="tail"></div>
<small class="chat-time">9:6</small>
</div>
<div class="chat-box">
<p>Some text</p>
<p> Another text.</p>
<small class="chat-time">9:6</small>
</div>
</div>
now another solution works for me
div #chat-casca .chat-box {
border-radius: 10px;
width: 323px;
background-color: white;
position: relative;
display: flex; /*add this line*/
flex-flow: wrap; /*and this line*/
margin-top: 12px;
left: 45px;
box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
-webkit-box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
-moz-box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
}
thanks everbody for try help me
Your tail div is interfering with the chat box's height.
Rather than using an actual div for the tail, try adding a class to the existing chat-casca div when you need the tail.
<div class="chat-box tail">
then add the ::before selector so it doesn't interfere with the other elements. Position this absolute and the chat-box positioned relative, then you can position the tail relative to the chat box.
#chat-casca .tail::before {
content: "";
width: 0px;
height: 0px;
position: absolute;
border-left: 10px solid transparent;
border-right: 10px solid #fff;
border-top: 10px solid #fff;
border-bottom: 10px solid transparent;
left: -19px;
top: 0px;
filter: drop-shadow(-4px 2px 2px rgba(166, 166, 166, 0.24));
}
#chat-casca .chat-box {
border-radius: 0 10px 10px 10px;
width: 323px;
background-color: white;
position: relative;
margin-top: 0;
margin-left: 45px;
height: auto;
box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
-webkit-box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
-moz-box-shadow: 0px 0px 5px 0px rgba(166, 166, 166, 0.60);
}
I wanted to add property further on clock so added a outline type effect property .
But whenever I hover on element parent element hover property is also activated . Know this is type bubbling/capturing effect in JS and also this is how CSS works.
Plz CSS only if possible : may be JS can be used like this
onhover="func()"
getElementId().style.boxShadow = " "
have to add to every element
Can it be possible have outline property on hovered element only .
Any suggestion on better property for outline-radius or outline effect with radius are very needed
Thanks for help
#clockOuterCircle {
display: flex;
justify-content: center;
align-items: center;
width: 42vw;
height: 42vw;
margin: auto;
border-radius: 50%;
border: 4px solid rgb(255, 62, 62);
background-color: rgb(253, 133, 133);
user-select: none;
}
#clockOuterCircle:hover {
box-shadow: 0 0 0 4px rgba(119, 239, 255, 0.5);
}
#clockInnerCircle {
position: relative;
width: 38vw;
height: 38vw;
text-align: center;
padding: 0%;
border-radius: 50%;
border: 6px solid black;
background-color: white;
}
#clockInnerCircle:hover {
box-shadow: 0 0 0 4px rgba(119, 239, 255, 0.5);
}
#clockStyleCircle {
position: absolute;
width: 16vw;
height: 16vw;
text-align: center;
padding: 0%;
top: 28.5%;
left: 28.5%;
border-radius: 50%;
border: 3px solid black;
background-color: rgb(255, 233, 35);
}
#clockStyleCircle:hover {
box-shadow: 0 0 0 4px rgba(119, 239, 255, 0.5);
}
#clockStyleEyeCircle1 {
position: absolute;
width: 4vw;
height: 4vw;
top: 24%;
left: 10%;
border: 3px solid black;
border-radius: 50%;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86);
/* inset 16px 0px #777, inset 16px 0px 1px 2px #777;*/
background-color: black;
}
#clockStyleEyeCircle2 {
position: absolute;
width: 4vw;
height: 4vw;
top: 24%;
left: 65%;
border: 3px solid black;
border-radius: 50%;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86);
background-color: black;
}
#clockStyleSimileCircle {
position: absolute;
width: 8vw;
height: 3vw;
top: 68%;
left: 25%;
border: 3px solid rgb(36, 36, 36);
/* border-radius: 0 0 50% 50% / 0 0 100% 100%; */
border-bottom-left-radius: 100% 200%;
border-bottom-right-radius: 100% 200%;
background-color: black;
box-shadow: inset 0px 1.5vw 1px 0.1vh rgb(255, 86, 86);
}
#clockCenterDot {
position: absolute;
width: 4%;
height: 4%;
top: 48%;
left: 48%;
border-radius: 50%;
background-color: rgba(0, 0, 0);
box-shadow: 3px 3px 10px;
z-index: 4;
}
#hourNeedle {
position: absolute;
height: 30%;
width: 2%;
top: 20%;
left: 49%;
background-color: rgb(0, 0, 0);
border-radius: 5px 5px 0 0;
box-shadow: 3px 3px 10px;
z-index: 1;
}
#minuteNeedle {
position: absolute;
height: 38%;
width: 1.6%;
top: 12%;
left: 49.2%;
background-color: rgba(0, 0, 0);
border-radius: 5px 5px 0 0;
box-shadow: 3px 3px 10px;
z-index: 2;
}
#secondNeedle {
position: absolute;
height: 46%;
width: 1%;
top: 8%;
left: 49.5%;
background-color: rgba(0, 0, 0);
border-radius: 5px 5px 0 0;
box-shadow: 3px 3px 10px;
z-index: 3;
}
<div id="clockOuterCircle">
<div id="clockInnerCircle">
<div id="clockStyleCircle">
</div>
<div id="clockCenterDot"></div>
</div>
</div>
I have this callout cloud, please have a look at the code.
div.callout {
background-color: #444;
background-image: -moz-linear-gradient(top, #444, #444);
position: relative;
color: #ccc;
padding: 10px;
border-radius: 3px;
box-shadow: 0px 0px 20px #999;
margin: 25px;
min-height: 100px;
border: 1px solid #333;
text-shadow: 0 0 1px #000;
width: 700px;
margin-top: -58px;
margin-left: 393px;
border-radius: 15px;
/*box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;*/
}
.callout::before {
content: "";
width: 0px;
height: 0px;
border: 0.8em solid transparent;
position: absolute;
}
.callout.right::before {
left: -20px;
top: 40%;
width: -10px;
margin-right: 10px;
border-right: 5px solid blue;
}
<div class="callout right"> </div>
I want to increase the size of the triangle (the blue one) at the start, I am unable to do that. please have a look and help me here.
You can increase the border width and adjust the location:
.callout.right::before {
left: -25px; /* adjust the location of triangle */
top: 40%;
margin-right: 10px;
border-right: 10px solid blue; /* increase the border width */
}
Here is the code snippet:
div.callout {
background-color: #444;
background-image: -moz-linear-gradient(top, #444, #444);
position: relative;
color: #ccc;
padding: 10px;
border-radius: 3px;
box-shadow: 0px 0px 20px #999;
margin: 25px;
min-height: 100px;
border: 1px solid #333;
text-shadow: 0 0 1px #000;
width: 700px;
margin-top: -58px;
margin-left: 393px;
border-radius: 15px;
/*box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;*/
}
.callout::before {
content: "";
width: 0px;
height: 0px;
border: 0.8em solid transparent;
position: absolute;
}
.callout.right::before {
left: -25px;
top: 40%;
margin-right: 10px;
border-right: 10px solid blue;
}
<div class="callout right"> </div>
You can adjust the code like this and you can easily change the dimension of the triangle by only changing the width of the border:
div.callout {
background-color: #444;
background-image:linear-gradient(top, #444, #444);
position: relative;
color: #ccc;
padding: 10px;
border-radius: 3px;
box-shadow: 0px 0px 20px #999;
margin: 25px;
min-height: 100px;
border: 1px solid #333;
width: 200px;
border-radius: 15px;
}
.callout::before {
content: "";
width: 0px;
height: 0px;
border: 0.8em solid transparent;
position: absolute;
}
.callout.right::before {
right:100%;
top: 50%;
transform:translateY(-50%);
border-right: 15px solid blue; /*Change only this value to control the size*/
}
<div class="callout right"> </div>
I have been attempting to make a glowing effect on a sphere in terms of internal 'shiny sphere' patterns, but have become stuck with the likes of positioning some aspects of the 'globe'.
As it currently stands, my css looks like:
.sphere {
height: 200px;
width: 200px;
background-color: red;
border-radius: 50%;
text-align: center;
vertical-align: middle;
line-height: 200px;
box-shadow: inset -10px -10px 100px #000, 10px 10px 20px black, inset 0px 0px 10px black;
}
.sphere::after {
background-color: rgba(255, 255, 255, 1);
content: '';
height: 15%;
width: 2%;
position: absolute;
top: 0.25%;
left: 3%;
border-radius: 50%;
transform: rotate(45deg);
}
.sphere2 {
height: 200px;
width: 200px;
background-color: yellow;
border-radius: 50%;
text-align: center;
vertical-align: middle;
line-height: 200px;
box-shadow: inset -10px -10px 100px #000, 10px 10px 20px black, inset 0px 0px 10px black;
}
.shine {
background-color: rgba(255, 255, 255, 0.5);
content: '';
height: 50%;
width: 15%;
left: 18%;
top: 0%;
position: relative;
border-radius: 50%;
transform: rotate(45deg);
}
<div class="sphere">High Importance</div>
<div class="sphere2">
<div class="shine"></div>
Important
</div>
CODEPEN
But the 'shine' effect on either sphere won't 'stay' in place. (Neither attempts full work).
Would anyone be able to point me in the right direction as to position these correctly (in the top left hand side, with a small margin)?
This will hopefully/eventually look similar to this (without the animated effect, that is)
Any advice would be much appreciated at this point (and i hope you can see where i'm going with this design, as i wish for it to be dynamically sized).
Just remember when you use absolute position you need to define the relative parent to position, this will be the closest with a non-static position defined. Try:
.sphere{
position:relative;
}
.sphere::after{
background-color: rgba(255,255,255,.5);
content:'';
height:50%;
width: 15%;
left:18%;
top:0%;
position:absolute;
border-radius:50%;
transform: rotate(45deg);
}
Codepen Updated
Position your .sphere and .sphere2 relatively and the ::after :pseudo-elements absolutely and give them same top and left values.
codepen
.sphere {
position: relative;
height: 200px;
width: 200px;
background-color: red;
border-radius: 50%;
text-align: center;
vertical-align: middle;
line-height: 200px;
box-shadow: inset -10px -10px 100px #000, 10px 10px 20px black, inset 0px 0px 10px black;
}
.sphere::after,
.sphere2::after {
background-color: rgba(255, 255, 255, 1);
content: '';
height: 40%;
width: 10%;
position: absolute;
top: 8%;
left: 14%;
border-radius: 50%;
transform: rotate(45deg);
}
.sphere2 {
height: 200px;
width: 200px;
position: relative;
background-color: yellow;
border-radius: 50%;
text-align: center;
vertical-align: middle;
line-height: 200px;
box-shadow: inset -10px -10px 100px #000, 10px 10px 20px black, inset 0px 0px 10px black;
}
.sphere2::after {
background-color: rgba(255, 255, 255, 0.5);
content: '';
position: absolute;
border-radius: 50%;
transform: rotate(45deg);
}
<div class="sphere">High Importance</div>
<div class="sphere2">
<div class="shine"></div>
Important
</div>
This is what i have got so far
After after checking out tutorial
I want know how curved effect is generated on divs the only question that i found near to what i was looking for was At here at stackoverlow but that too dint help
How folded edge effect is created on as in the above picture
Css
#MenuShape{
height:50px;
background-color:orange;
width:200px;
position:relative;
text-align:center;
left:100px;
}
#MenuShape:after{
content:"";
position: absolute;
width: 0;
height: 0;
left:200px;
border-top: 50px solid transparent;
border-left: 100px solid orange;
border-bottom: 0px solid transparent;
}
#MenuShape:before{
content:"";
position: absolute;
width: 0;
height: -50;
left:-100px;
border-top: 50px solid transparent;
border-right: 100px solid orange;
border-bottom: 0px solid transparent;
}
HTML
<div id="MenuShape" >
sachin
</div>
https://css-tricks.com/ this the site on inspecting it i found its span wrapped
anchor tag along with svg tag
<a href="/" class="home">
<svg viewBox="0 0 100 25" class="shape-tab">
<use xlink:href="#shape-tab"></use>
</svg>
<span>Blog</span></a>
Click here to see the unexpected behaviour it works fine in codepen
Here is a final demo (archived) on the folded corners:
and the following code is how you can create them:
.note {
position: relative;
width: 30%;
padding: 1em 1.5em;
margin: 2em auto;
color: #fff;
background: #97C02F;
overflow: hidden;
}
.note:before {
content: "";
position: absolute;
top: 0;
right: 0;
border-width: 0 16px 16px 0;
border-style: solid;
border-color: #fff #fff #658E15 #658E15;
background: #658E15;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), -1px 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), -1px 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), -1px 1px 1px rgba(0, 0, 0, 0.2);
/* Firefox 3.0 damage limitation */
display: block;
width: 0;
}
.note.rounded {
-moz-border-radius: 5px 0 5px 5px;
border-radius: 5px 0 5px 5px;
}
.note.rounded:before {
border-width: 8px;
border-color: #fff #fff transparent transparent;
-moz-border-radius: 0 0 0 5px;
border-radius: 0 0 0 5px;
}
<div class="note"></div>
To create a curved wave effect you can use this code:
#wave {
position: relative;
height: 70px;
width: 600px;
background: #e0efe3;
}
#wave:before {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 340px;
height: 80px;
background-color: white;
right: -5px;
top: 40px;
}
#wave:after {
content: "";
display: block;
position: absolute;
border-radius: 100% 50%;
width: 300px;
height: 70px;
background-color: #e0efe3;
left: 0;
top: 27px;
}
<div id="wave"></div>
To achieve the curve you’ll need to inverse where it starts. Follow the same demo, just reverse your values.
See a live demonstration (archived) of how border radius can create the shapes and effects you want and adjust each corner to see it in action.