Css Shape Creation Curved Wave - html

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.

Related

Speech Bubble with triangle & translucent background

Hi I am trying to make a translucent speech bubble with a border. To make the triangle I am using a ::before element for large triangle and an ::after for a smaller one that sits on top, so it looks like it has a border. But since I want it translucent, the ::before element can be seen and ruins it. Please help me to fix this
.bubble {
max-width: 75%;
min-width: 200px;
padding: 8px 12px 0 12px;
position: relative;
border-radius: 4px;
text-align: left;
margin-left: auto;
background-color: rgba(255, 0, 0, 0.3);
border: 1px solid black;
border-top-right-radius: 0;
margin-right: 16px;
}
.bubble::before, .bubble::after {
position: absolute;
width: 0;
height: 0;
top: 0;
content: '';
border-style: solid;
right: 0;
transform: translateX( 100% );
}
.bubble::before {
border-color: black transparent transparent transparent;
border-width: 18px 18px 0 0;
top: -1px;
}
.bubble::after {
border-color: rgba(255, 0, 0, 0.3) transparent transparent transparent;
border-width: 16px 16px 0 0;
}
<div class="bubble">
<p>
Hello
</p>
</div>
A skew transformation can help you here:
.bubble {
max-width: 75%;
min-width: 200px;
padding: 8px 12px 0 12px;
position: relative;
border-radius: 0 0 4px 4px;
margin-top:40px;
border: 1px solid black;
border-top:0;
margin-right: 16px;
}
.bubble::before,
.bubble::after{
content: '';
position: absolute;
width: 70%;
height: 20px;
top: -21px;
border:1px solid;
}
.bubble::before {
right:-1px;
border:1px solid;
border-width:1px 1px 0 0;
transform-origin:bottom;
transform:skew(-45deg);
}
.bubble::after{
left:-1px;
border-width:1px 0 0 1px;
border-radius:4px 0 0 0;
}
p {
margin-top:0;
}
<div class="bubble">
<p>
Hello
</p>
</div>
Try a same color without transparency using color-picker . It can solve your problem .
See in below snippet
.bubble {
max-width: 75%;
min-width: 200px;
padding: 8px 12px 0 12px;
position: relative;
border-radius: 4px;
text-align: left;
margin-left: auto;
background-color: rgba(255, 0, 0, 0.3);
border: 1px solid black;
border-top-right-radius: 0;
margin-right: 16px;
}
.bubble::before, .bubble::after {
position: absolute;
width: 0;
height: 0;
top: 0;
content: '';
border-style: solid;
right: 0;
transform: translateX( 100% );
}
.bubble::before {
border-color: black transparent transparent transparent;
border-width: 18px 18px 0 0;
top: -1px;
}
.bubble::after {
border-color: rgb(255, 178, 178) transparent transparent transparent;
border-width: 16px 16px 0 0;
}
<div class="bubble">
<p>
Hello
</p>
</div>
I've created an svg for you. Would this help?
<svg
id="ff27feca-6648-4bac-87a3-a2646769617b"
data-name="Layer 1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 694 178"
>
<defs>
<style>
.a7bae820-8942-4935-b994-ad6a9d32b3d2 {
fill: none;
stroke: #000;
stroke-miterlimit: 10;
stroke-width: 10px;
}
</style>
</defs>
<path
class="a7bae820-8942-4935-b994-ad6a9d32b3d2"
d="M567.37,164H44.63A29.64,29.64,0,0,1,15,134.37V45.63A29.64,29.64,0,0,1,44.63,16H667L597,67v67.37A29.64,29.64,0,0,1,567.37,164Z"
/>
</svg>

Display the full image over the card

In this card, I have given an image tag. When I run the code half of the image gets hidden. My exception is that the image should overwrite the card like this:
.
So please let me know how to achieve this.
Here is my code:
.section6-card1-diagonal {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-color: transparent;
width: 246px;
height: 406px;
border-color: lightgrey;
margin-left: 20px;
margin-top: 20px;
margin-bottom: 20px;
position: relative;
overflow: hidden;
}
.cards1 {
border-bottom: 225px solid #846EB1;
border-left: 401px solid transparent;
position: absolute;
bottom: 0;
left: -155px;
}
<div class="card section6-card1-diagonal">
<h5>Dell Inspiron Heavy metallic Display</h5>
<img class="section4-image" src="https://i5.walmartimages.com/asr/726f43a4-2dbb-4340-adc1-ce798580ba23_1.c5ced9469e3036a57d81678e9ebd2f1d.jpeg" />
<div class="cards1">
</div>
</div>
Here is a simple solution .
Just give negative z-index to the .cards1
.cards1 {
border-bottom: 225px solid #846EB1;
border-left: 401px solid transparent;
position: absolute;
bottom: 0;
left: -155px;
z-index:-1;
}
That will bring the div behind the image , Because the Image will have more priority in simple words
play width .section4-image class for better styling
.section6-card1-diagonal {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-color: transparent;
width: 246px;
height: 406px;
border-color: lightgrey;
margin-left: 20px;
margin-top: 20px;
margin-bottom: 20px;
position: relative;
overflow: hidden;
}
.cards1 {
border-bottom: 225px solid #846EB1;
border-left: 401px solid transparent;
position: absolute;
bottom: 0;
left: -155px;
}
.section4-image {
height: 55vh;
background-color: "red";
width: 52vh;
margin-left: 10%;
margin-top: 0%;
}
<div class="card section6-card1-diagonal">
<h5>Dell Inspiron Heavy metallic Display</h5>
<img class="section4-image" src="https://i5.walmartimages.com/asr/726f43a4-2dbb-4340-adc1-ce798580ba23_1.c5ced9469e3036a57d81678e9ebd2f1d.jpeg" />
<div class="cards1">
</div>
</div>
Firstly: you need to upload transparent image (PNG) image of desktop.
Secondly: you need to upload small resolution image.
Currently you uploaded high resolution image which is 1500x1500
Now you need to add below css to show you image and also make it transparent.
.section4-image {
width:100%;
}
After make transparent image you need to add z-index css on image for show up on the shape.
.cards1 {
border-bottom: 225px solid #846EB1;
border-left: 401px solid transparent;
position: absolute;
bottom: 0;
z-index: -1;
}
.section4-image {
z-index: 1;
}
`
.section6-card1-diagonal {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-color: transparent;
width: 246px;
height: 406px;
border-color: lightgrey;
margin-left: 20px;
margin-top: 20px;
margin-bottom: 20px;
position: relative;
overflow: hidden;
}
.cards1 {
border-bottom: 225px solid #846EB1;
border-left: 401px solid transparent;
position: absolute;
bottom: 0;
left: -155px;
}
.section4-image {
width:100%;
}
<div class="card section6-card1-diagonal">
<h5>Dell Inspiron Heavy metallic Display</h5>
<img class="section4-image" src="https://i5.walmartimages.com/asr/726f43a4-2dbb-4340-adc1-ce798580ba23_1.c5ced9469e3036a57d81678e9ebd2f1d.jpeg" />
<div class="cards1">
</div>
</div>

How to move the arrow to the right in the input field?

.wrapper-dropdown-3 {
width: 200px;
margin: 0 auto;
padding: 10px;
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
font-weight: bold;
color: #8AA8BD;
}
.wrapper-dropdown-3:after {
content: "";
width: 0;
height: 0;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
}
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Transport</span>
</div>
In the above code I want to insert the blue arrow to the middle right of the .wrapper-dropdown-3. As of now it is situated on the top right near the Transport span. I am not sure how I can move it to the very right middle? Any suggestions?
You can use absolute positioning against container:
.wrapper-dropdown-3 {
width: 200px;
margin: 0 auto;
padding: 10px;
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
font-weight: bold;
color: #8AA8BD;
position: relative;
}
.wrapper-dropdown-3:after {
content: "";
width: 0;
height: 0;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
position: absolute;
right: 5px;
top: calc(50% + 6px / 2); /* 6px here is border-width value to compensate a fact that arrow is made from border */
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Transport</span>
</div>
Simply use positionning like this :
.wrapper-dropdown-3 {
width: 200px;
margin: 0 auto;
padding: 10px;
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
font-weight: bold;
color: #8AA8BD;
/*Code added*/
position:relative;
/**/
}
.wrapper-dropdown-3:after {
/*Code added*/
position:absolute;
right:5px;
top:50%;
/**/
content: "";
width: 0;
height: 0;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
}
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Transport</span>
</div>

Cut a corner on my box container using CSS

This is what I want to achieve:
I'm looking to "cut" the lower left corner of the content in the code below
(similar to if you had folded the corner of a page down)
I'd like to know if there is any adjustments I could do to the CSS below to achieve this.
.model-properties {
padding: 0.8em 3em;
position: absolute;
top: 0px;
right: 0px;
width: 20%;
min-width: 15%;
z-index: 2;
display: none;
color: #c6d2db;
font-size: 13px;
background: linear-gradient(180deg, #182229, #182229, #293741, #293741);
max-height: 700px;
overflow: auto;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
<div id="model-properties-container" class="model-properties">
.model-properties:before,
.model-properties:after
{
bottom: 0;
left: 0;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.model-properties:after {
border-color: #88b7d5;
border-left-color: white;
border-bottom-color: white;
border-width: 30px;
}
https://jsfiddle.net/e46xvp3x/3/

HTML/CSS Dialog - Trying to get Arrow on Left Side

I have the following image working in HTML/CSS but now I need the same except with the arrow on the upper left side. Also a longer arrow (but I'm sure I can figure that out).
I've create a fiddle here http://jsfiddle.net/bnzuug5b/4/
However the arrow (on the left) is pointing the wrong way.
Below is the CSS I've been working with:
#chatCenterMemberInfoPopOutContainerDIV {
border-radius: .1875em;
z-index: 5;
position: absolute;
box-shadow: 0 0 0 1px rgba(0,0,0,0.15),inset 0 0 0 1px rgba(255,255,255,0.6), 0 4px 2px -2px rgba(0,0,0,0.2),0 0 1px 1px rgba(0,0,0,0.15);
background-repeat: repeat-x;
background-position: 0 0;
background-image: linear-gradient(to bottom,rgba(255,255,255,0.7) 0,rgba(255,255,255,0) 100%);
background-color: #e1e1e1;
width: 140px;
height: 80px;
left: 50px;
top: 50px;
display: block;
}
#chatCenterMemberInfoPopOutContainerDIV:before {
border-left-color: #aaa;
border-width: 5.5px;
margin-top: -1.5px;
}
#chatCenterMemberInfoPopOutContainerDIV:after, #chatCenterMemberInfoPopOutContainerDIV:before {
border: 4px solid transparent;
border-left-color: #f2f2f2;
position: absolute;
content: '';
right: 100%;
top: 9px;
}
#chatCenterMemberInfoPopOutContainerDIV:after, #chatCenterMemberInfoPopOutContainerDIV:before {
border: 4px solid transparent;
border-left-color: #f2f2f2;
position: absolute;
content: '';
right: 100%;
top: 9px;
}
Any assistance would be greatly appreciated - used on site: http://www.musician.dating
thx
To get the arrow facing to the left side you need to set top and bottom's border-color to transparent and give a color to border-right.
#chatCenterMemberInfoPopOutContainerDIV {
border-radius: .1875em;
z-index: 5;
position: relative;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 4px 2px -2px rgba(0, 0, 0, 0.2), 0 0 1px 1px rgba(0, 0, 0, 0.15);
background-repeat: repeat-x;
background-position: 0 0;
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0) 100%);
background-color: #e1e1e1;
width: 140px;
height: 80px;
left: 50px;
top: 50px;
}
#chatCenterMemberInfoPopOutContainerDIV:before,
#chatCenterMemberInfoPopOutContainerDIV:after {
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right: 14px solid #F5F5F5;
position: absolute;
content: '';
top: 15px;
left: -14px;
}
#chatCenterMemberInfoPopOutContainerDIV:before {
border-top: 9px solid transparent;
border-bottom: 9px solid transparent;
border-right: 15px solid #CECECE;
top: 13px;
left: -15px;
}
<div id="chatCenterMemberInfoPopOutContainerDIV"></div>
Find the following id's in your css
#chatCenterMemberInfoPopOutContainerDIV:after, #chatCenterMemberInfoPopOutContainerDIV:before
and change
border-left-color: #f2f2f2;
to be:
border-right-color: #f2f2f2;
FIDDLE
Create a div with triangle shape and provide the margins.
Try this enter code herehttp://jsfiddle.net/sathyanaga/fyt4fagL/`