How can I make the bottom of my div have a peak shape?
up vote
1
down vote
favorite
I am trying to make my div have this form:
I only get this result with the code I am using:
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
}
<div></div>
Thanks for you help guys!
html css html5 css3
add a comment |
up vote
1
down vote
favorite
I am trying to make my div have this form:
I only get this result with the code I am using:
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
}
<div></div>
Thanks for you help guys!
html css html5 css3
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to make my div have this form:
I only get this result with the code I am using:
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
}
<div></div>
Thanks for you help guys!
html css html5 css3
I am trying to make my div have this form:
I only get this result with the code I am using:
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
}
<div></div>
Thanks for you help guys!
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
}
<div></div>
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 70%, 0% 100%);
}
<div></div>
html css html5 css3
html css html5 css3
edited Nov 11 at 4:05
Smollet777
544314
544314
asked Nov 10 at 16:54
jlgf
397
397
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
If it's only about coloration you don't need to use clip-path
. You can easily achieve this with multiple background and have a better support:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
In case you need the black border you can adjust like below:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
add a comment |
up vote
2
down vote
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
This link is helpful https://bennettfeely.com/clippy/
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
If it's only about coloration you don't need to use clip-path
. You can easily achieve this with multiple background and have a better support:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
In case you need the black border you can adjust like below:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
add a comment |
up vote
2
down vote
accepted
If it's only about coloration you don't need to use clip-path
. You can easily achieve this with multiple background and have a better support:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
In case you need the black border you can adjust like below:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
If it's only about coloration you don't need to use clip-path
. You can easily achieve this with multiple background and have a better support:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
In case you need the black border you can adjust like below:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
If it's only about coloration you don't need to use clip-path
. You can easily achieve this with multiple background and have a better support:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
In case you need the black border you can adjust like below:
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue 49.8%,transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, blue 49.8%,transparent 50%) bottom left/50.2% 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
div.box {
height: 300px;
background:
linear-gradient(blue,blue) top/100% 70%,
linear-gradient(to bottom right,blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom right -20px/calc(50% + 20px) 30%,
linear-gradient(to bottom left, blue calc(50% - 5px),#000 calc(50% - 5px),#000 49.8%,transparent 50%) bottom left -20px/calc(50% + 21px) 30%;
background-repeat:no-repeat;
margin-bottom:20px;
}
<div class="box">
</div>
edited Nov 10 at 18:37
answered Nov 10 at 18:25
Temani Afif
59.5k93472
59.5k93472
add a comment |
add a comment |
up vote
2
down vote
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
This link is helpful https://bennettfeely.com/clippy/
add a comment |
up vote
2
down vote
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
This link is helpful https://bennettfeely.com/clippy/
add a comment |
up vote
2
down vote
up vote
2
down vote
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
This link is helpful https://bennettfeely.com/clippy/
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
This link is helpful https://bennettfeely.com/clippy/
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
div {
background: lightblue;
height: 34rem;
-webkit-clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
}
<div></div>
answered Nov 10 at 17:07
Smollet777
544314
544314
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241221%2fhow-can-i-make-the-bottom-of-my-div-have-a-peak-shape%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown