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>
Related
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;
}
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>
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/
This question already has answers here:
transparent shape with arrow in upper corner
(2 answers)
Closed 7 years ago.
I have this custom shape made with css. I need to give a border to it but I have unsuccessful so far. How can I give it a border?
.comment-input-container {
width: 96%;
float: left;
}
input[type='text'] {
border: 0px !important;
box-shadow: none;
background-color: #f2f2f2;
box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.1);
padding: 5px;
}
.arrow-left {
float: left;
width: 0;
height: 0;
border-bottom: 10px solid #fff;
border-right: 10px solid #f2f2f2;
}
<div style="width: 300px;">
<div class="arrow-left">
</div>
<div class="comment-input-container">
<input type="text" placeholder="Reply to comment..." />
</div>
</div>
Also, another problem is that the arrow and input break for smaller devices, that is, the input gets stacked underneath the arrow. Is there a better way of creating this shape that is also responsive and stays intact?
Thanks to Harry, I was able to work out a laregely responsive solution:
.comment-input-container {
position: relative;
width: 100%;
border-left: none;
/* not required as the shape needs to be transparent */
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
.comment-input-container:before {
position: absolute;
content: '';
top: 0px;
left: -7px;
height: 26%;
width: 10%;
background-color: #f6f7fb;
border-top: 1px solid #e6e6e6;
border-left: 1px solid #e6e6e6;
-webkit-transform-origin: bottom right;
-webkit-transform: skew(45deg);
-moz-transform: skew(45deg);
transform: skew(45deg);
}
.comment-input-container:after {
position: absolute;
content: '';
left: -7px;
height: 74%;
width: 5%;
max-width: 15px;
bottom: 0px;
border-left: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
background-color: #f6f7fb;
}
input[type="text"] {
border: 1px solid #e6e6e6;
border-left: none;
box-shadow: none;
background-color: #f6f7fb;
box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.1) !important;
margin: 0px;
padding: 10px;
outline: none;
}
input[type="text"]:focus {
border: 1px solid #e6e6e6;
border-left: none;
box-shadow: none;
background-color: #f6f7fb !important;
box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.1) !important;
padding: 10px;
outline: none;
}
.comment-box {
margin-left: 50px;
height: 50px;
}
<div class="comment-box">
<div class="comment-input-container">
<input type="text" placeholder="Reply to comment..." />
</div>
</div>
I assume the special shape is the last one? It's 0px x 0px, but you should see something since you gave it a 10px border. Unfortunately, The border is white so it blended in with the white background. I made the shape 1px x 1px and the background black so you can see the shape better.
body { background: black; }
.comment-input-container {
width: 96%;
float: left;
}
input[type='text'] {
border: 0px !important;
box-shadow: none;
background-color: #f2f2f2;
box-shadow: inset 0 0px 0px rgba(0, 0, 0, 0.1);
padding: 5px;
}
.arrow-left {
float: left;
width: 1px;
height: 0px;
border-bottom: 10px solid rgba(0, 0, 0, 0.0);
border-right: 10px solid #f2f2f2;
box-shadow: inset 4px 2px 22px 6px rgba(0,0,0,0.57);
outline: 2px inset rgba(0, 0, 0, .35;
}
<div style="width: 300px;">
<div class="arrow-left">
</div>
<div class="comment-input-container">
<input type="text" placeholder="Reply to comment..." />
</div>
</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.