Corner ribbon in responsive image - html

I need to align the corner ribbon to my image. here's what I managed to do:
<div class="row">
<div class="col-sm-6">
<a href="http://website.com">
<img src="/images/web1.jpg"><div class="ribbon"><span>Featured</span></div></img>
</a><br><br>
<hr>
</div>
<div class="col-sm-6">
<a href="http://website.com">
<img src="/images/web2.jpg"><div class="ribbon"><span>Featured</span></div></img>
</a><br><br>
<hr>
</div>
</div>
the css
.ribbon {
position: absolute;
right: 62px; top: -5px;
z-index: 1;
overflow: hidden;
width: 75px;
height: 75px;
text-align: right;
}
.ribbon span {
font-size: 10px;
color: #fff;
text-transform: uppercase;
text-align: center;
font-weight: bold; line-height: 20px;
transform: rotate(45deg);
width: 100px; display: block;
background: #79A70A;
background: linear-gradient(#9BC90D 0%, #79A70A 100%);
box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 1);
position: absolute;
top: 19px; right: -21px;
}
.ribbon span::before {
content: '';
position: absolute;
left: 0px; top: 100%;
z-index: -1;
border-left: 3px solid #79A70A;
border-right: 3px solid transparent;
border-bottom: 3px solid transparent;
border-top: 3px solid #79A70A;
}
.ribbon span::after {
content: '';
position: absolute;
right: 0%; top: 100%;
z-index: -1;
border-right: 3px solid #79A70A;
border-left: 3px solid transparent;
border-bottom: 3px solid transparent;
border-top: 3px solid #79A70A;
}
the ribbon works fine if I put a fixed height and width, but how do I make the ribbon stick to the right corner of the image? Thanks
EDITED
<div class="row">
<div class="col-sm-6">
<div class="wrappersa"> <a href="http://website.com">
<img class="img-responsive" src="/images/web3.jpg" />
<div class="ribbon-wrapper-green">
<div class="ribbon-green">New</div>
</div>
</a><br><br>
<p><strong>Website</strong<br>This is a website</p><br><hr>
</div>
</div>
<div class="col-sm-6">
</div>
</div>
</div>
CSS
.wrappersa {
margin: 20px auto;
width: 450px;
height: 430px;
position: relative;
}
.ribbon-wrapper-green {
width: 85px;
height: 88px;
overflow: hidden;
position: absolute;
top: -3px;
right: -3px;
}
.ribbon-green {
font-size: 10px;
color: #fff;
text-transform: uppercase;
text-align: center;
font-weight: bold;
line-height: 20px;
transform: rotate(45deg);
width: 100px;
display: block;
background: #79A70A;
background: linear-gradient(#9BC90D 0%, #79A70A 100%);
box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 1);
position: absolute;
top: 19px;
right: -21px;
}
.ribbon-green:before, .ribbon-green:after {
content:'';
position: absolute;
left: 0px;
top: 100%;
z-index: -1;
border-left: 3px solid #79A70A;
border-right: 3px solid transparent;
border-bottom: 3px solid transparent;
border-top: 3px solid #79A70A;
}
#media (max-width : 992px) {
.wrappersa {
margin: 20px auto;
width: 100%;
height: auto;
position: relative;
}
}

This might help but as you said, the ribbon doesn't truly take into account if the image size is dynamically changed so all image sizes have to be fixed and the same.
Updated with bottom text caption.
figure {
display: inline-block;
}
figure img {
vertical-align: top;
}
figure figcaption {
padding: 5px 0;
text-align: center;
background: #9BC90D;
}
.wrapper a {
color: #fff;
}
/*****************/
.wrapper {
margin: 20px auto;
width: 450px;
height: 430px;
position: relative;
}
.ribbon-wrapper-green {
width: 85px;
height: 88px;
overflow: hidden;
position: absolute;
top: -3px;
right: -3px;
}
.ribbon-green {
font-size: 10px;
color: #fff;
text-transform: uppercase;
text-align: center;
font-weight: bold;
line-height: 20px;
transform: rotate(45deg);
width: 100px;
display: block;
background: #79A70A;
background: linear-gradient(#9BC90D 0%, #79A70A 100%);
box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 1);
position: absolute;
top: 19px;
right: -21px;
}
.ribbon-green:before,
.ribbon-green:after {
content: '';
position: absolute;
left: 0px;
top: 100%;
z-index: -1;
border-left: 3px solid #79A70A;
border-right: 3px solid transparent;
border-bottom: 3px solid transparent;
border-top: 3px solid #79A70A;
}
#media (max-width: 992px) {
.wrapper {
margin: 20px auto;
width: 100%;
height: auto;
position: relative;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="wrapper">
<a href="https://something.io">
<figure>
<img class="img-responsive" src="http://placehold.it/950x500/1c1c1c/fff/?text=Image" />
<figcaption><strong>Website</strong>
<br>This is a website
</figcaption>
</figure>
<div class="ribbon-wrapper-green">
<div class="ribbon-green">New</div>
</div>
</a>
<hr>
</div>
</div>
<div class="col-sm-6">
<div class="wrapper">
<a href="https://something.io">
<figure>
<img class="img-responsive" src="http://placehold.it/950x500/1c1c1c/fff/?text=Image" />
<figcaption><strong>Website</strong>
<br>This is a website
</figcaption>
</figure>
<div class="ribbon-wrapper-green">
<div class="ribbon-green">New</div>
</div>
</a>
<hr>
</div>
</div>
</div>
</div>

Related

Make image width 100% and the word on the image still properly highlighted

I want to make the width of an image relative to it's parent div and still the highlighted box properly alinged on the words. But when I give image 100% width, it will not properly aligned.
Fiddle: https://jsfiddle.net/cv7g149k/3/
.summary {
background-color: #fff;
border: 2px solid #9197ae;
width: 700px;
padding: 15px;
margin: auto;
z-index: 1;
text-align: left;
box-shadow: 0 0 3px #000;
}
.image-results {
max-width: 700px;
margin: auto;
}
.image-holder {
display: block;
position: relative;
}
.word-highlight {
background-color: rgba(240, 45, 58, 0.3);
border: 1px solid rgba(240, 45, 58, 0.4);
position: absolute;
border-radius: 4px;
margin: -2px -4px;
padding: 2px 4px;
box-sizing: initial !important;
}
<div class="summary align-items-center">
<div class="px-2">
Number of Detected Words:<span>64</span>
</div>
<div class="px-2">
Detected words: <span>Python, Javascript</span>
</div>
</div>
<div class="image-results">
<div class="image-holder">
<img src="https://miro.medium.com/max/1400/0*GV5Xm8Ve-tb_qAAs" class="iimg-width-banned-words">
<div class="word-highlight" style="left: 171px; top: 173px; width: 70px; height: 22px;"></div>
<div class="word-highlight" style="left: 141px; top: 241px; width: 100px; height: 22px;"></div>
</div>
</div>
Instead of specifying exact px for the position of word-highlight classes, you may want to use % to define the position
.summary {
background-color: #fff;
border: 2px solid #9197ae;
width: 700px;
padding: 15px;
margin: auto;
z-index: 1;
text-align: left;
box-shadow: 0 0 3px #000;
}
.image-results {
max-width: 700px;
margin: auto;
}
.image-holder {
display: block;
position: relative;
}
.word-highlight {
background-color: rgba(240, 45, 58, 0.3);
border: 1px solid rgba(240, 45, 58, 0.4);
position: absolute;
border-radius: 4px;
margin: -2px -4px;
padding: 2px 4px;
box-sizing: initial !important;
}
img {
width: 100%;
}
<div class="summary align-items-center">
<div class="px-2">
Detected words:<span>64</span>
</div>
</div>
<div class="image-results">
<div class="image-holder">
<img src="https://miro.medium.com/max/1400/0*GV5Xm8Ve-tb_qAAs" class="iimg-width-banned-words">
<div class="word-highlight" style="left: 12%; top: 19%; width: 5.5%; height: 4%;"></div>
<div class="word-highlight" style="left: 10%; top: 26.5%; width: 8%; height: 4%;"></div>
</div>
</div>
Add width: 100%; and height: 100%: to your image class so that it fills 100% of the parent div. Then you will have to adjust your values for word-highlight.
.summary {
background-color: #fff;
border: 2px solid #9197ae;
width: 700px;
padding: 15px;
margin: auto;
z-index: 1;
text-align: left;
box-shadow: 0 0 3px #000;
}
.image-results {
max-width: 700px;
margin: auto;
}
.image-holder {
display: block;
position: relative;
}
.word-highlight {
background-color: rgba(240, 45, 58, 0.3);
border: 1px solid rgba(240, 45, 58, 0.4);
position: absolute;
border-radius: 4px;
margin: -2px -4px;
padding: 2px 4px;
box-sizing: initial !important;
}
.img-width-banned-words {
height: 100%;
width: 100%;
}
<div class="summary align-items-center">
<div class="px-2">
Number of Detected Words:<span>64</span>
</div>
<div class="px-2">
Detected words: <span>Python, Javascript</span>
</div>
</div>
<div class="image-results">
<div class="image-holder">
<img src="https://miro.medium.com/max/1400/0*GV5Xm8Ve-tb_qAAs" class="img-width-banned-words">
<div class="word-highlight" style="left: 80px;top: 83px;width: 44px;height: 20px;"></div>
<div class="word-highlight" style="left: 73px; top: 117px; width: 47.5px; height: 20px;"></div>
</div>
</div>

How to make a speech bubble with CSS?

Is it possible to style the following HTML structure to the image shown below with CSS only?
<div class="xyz-dialog">
<div class="title"><span> Tip Title</span></div>
<div class="body"> <span>Description</span></div>
</div>
Required design:
You can do it as below if we can add a container div in the HTML:
.container{
background: gray;
padding: 16px 10px;
width:max-content;
}
.xyz-dialog {
background: white;
padding: 1rem;
border-radius: 8px;
position: relative;
width: 300px;
}
.xyz-dialog::after {
content: "";
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid white;
position: absolute;
top: 100%;
}
.body {
margin-top:8px;
color: gray;
font-size: 15px
}
<div class= "container">
<div class="xyz-dialog">
<div class="title"><span> Tip Title</span></div>
<div class="body"> <span>Description</span></div>
</div>
You can do it as below if we cannot touch the HTML structure:
.xyz-dialog {
padding: 1rem;
border-radius: 8px;
position: relative;
width: 300px;
}
.xyz-dialog::after {
content: "";
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid white;
position: absolute;
top: calc(100% -1rem);
left: 2rem;
}
.xyz-dialog::before {
content: "";
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: gray;
z-index: -1;
}
.title {
padding: 1rem;
background: white;
border-radius: 10px 10px 0 0;
margin: 0 0 -5px 0;
}
.body {
color: gray;
font-size: 15px;
background: white;
margin: 0;
padding: 1rem;
border-radius: 0 0 10px 10px;
}
<div class="xyz-dialog">
<div class="title"><span> Tip Title</span></div>
<div class="body"> <span>Description</span></div>
</div>
You can use after and border.
.xyz-dialog::after{
content: "";
border-top: 12px solid #f1f1f1;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
position: absolute;
bottom: -12px;
left: 4%;
}
.xyz-dialog{
width: 50%;
background: #f1f1f1;
border-radius: 0.3em;
padding: 5px 30px;
position: relative;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
box-sizing: border-box;
flex-direction: column;
}
<div class="xyz-dialog">
<div class="title"><span> Tip Title</span></div>
<div class="body"> <span>Description</span></div>
</div>
Little late. Two Boxes. For the small noise you use the css pseudo class after.
body {
background-color: #999;
}
.wrapper {
padding:20px;
}
h3 {
margin:0;
color: #000;
}
.bubble {
position: relative;
background: white;
color: #999;
font-family: Arial;
font-size: 16px;
text-align: left;
width: 250px;
height: 120px;
border-radius: 10px;
padding: 0px;
}
.bubble:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-width: 0 20px 20px 0;
border-color: transparent #fff transparent transparent;
bottom: -16px;
left: 17%;
margin-left: -10px;
}
<div class="bubble">
<div class="wrapper">
<h3>title</h3>
<div>content</div>
</div>
</div>

Circle with fading borders on the bottom

I'm trying to draw this output with css (or svg). For me, the tough part is the half-arc at the left and right side of the circle. Should I stick to pure css or is it better using images?
Any help is appreciated...
This is what I managed to make :
Here is the code :
body {
background-color: #002911 !important;
}
h3 {
color: #ffd004;
}
#actions-container {
margin-top: 30px;
}
#actions-container .action-icon {
width: 200px;
height: 200px;
background-color: rgb(255, 208, 4);
border-radius: 50%;
box-shadow: 5px -2px 6px 3px #0000004a;
/* center contents*/
display: flex;
justify-content: center;
align-items: center;
}
.right-arc {
position: relative;
display: inline-block;
font-size: 30px;
color: lightgreen;
margin: 40px;
}
.right-arc::after {
content: '';
position: absolute;
right: -150px;
top: 57px;
height: 300px;
width: 300px;
border-radius: 50% 50% 50% 50%;
border-width: 0px 1px 0px 0px;
border-style: solid;
/*border-top: outset;*/
}
/*svg {
width: 33%;
height: auto;
}*/
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
<div class="container" id="actions-container">
<div class="d-flex justify-content-between">
<div class="action-icon-box text-center ">
<div class="right-arc">
</div>
<h3 class="text-center">Title</h3>
<div class="p-1 action-icon text-center mt-4">
<img class="center" src="/Content/images/lp-homepage/microphone.png" height="100" />
</div>
</div>
</div>
</div>
You could use a pseudo element with an inset box-shadow to create the fade out border on the bottom like this :
body {
background: #232323;
}
.wrap {
box-sizing: border-box;
position: relative;
width: 50%;
border: 3px solid #ffd004;
border-radius: 50%;
}
.wrap::before {
content:'';
display:block;
padding-bottom:100%;
}
.wrap::after {
content: '';
position: absolute;
bottom: -3px;
left: -3px;
right: -3px;
height: 100%;
z-index: 1;
box-shadow: inset 0px -270px 70px -100px #232323;
}
.title {
color: #ffd004;
margin: 0;
position: absolute;
top: -3px;
left: 0;
width: 100%;
text-align: center;
z-index: 2;
background: #232323;
}
.circle {
position: absolute;
top:15%;
left:15%;
width: 70%;
height: 70%;
border-radius: 50%;
background: #ffd004;
z-index: 2;
}
<div class="wrap">
<h2 class="title">Title</h2>
<div class="circle"></div>
</div>
Be aware that this will only work on plain color background. If you need to display this over a gradient or image, I highly suggest using SVG.
The aspect ratio of the circle is kept using the "padding technique" from this answer : Maintain the aspect ratio of a div with CSS
If you need transparency, you can use a mask-image with a linear-gradient.
/* based on #web-tiki's implementation */
body {
background: #232323;
}
.wrap {
box-sizing: border-box;
position: relative;
width: 50%;
padding: 60px;
}
/* the border */
.wrap::before {
content:"";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 3px solid #ffd004;
border-radius: 50%;
-webkit-mask-image: linear-gradient(transparent 10%, black 10%, transparent 80% );
mask-image: linear-gradient(transparent 10%, black 10%, transparent 80% );
}
/* the circle */
.wrap::after {
content:"";
display:block;
background: #ffd004;
padding-top: 100%;
border-radius: 50%;
box-shadow: 6px 0px 10px black;
}
.title {
color: #ffd004;
margin: 0;
position: absolute;
top: -3px;
left: 0;
right: 0;
text-align: center;
}
body:hover {
/* CSS checkerboard stolen from https://drafts.csswg.org/css-images-4/#example-2de97f53 */
background: repeating-conic-gradient(rgba(0,0,0,0.1) 0deg 25%, white 0deg 50%);
background-size: 2em 2em;
}
<div class="wrap">
<h2 class="title">Title</h2>
</div>
Try this
body {
background-color: #002911 !important;
}
h3 {
color: #ffd004;
}
#actions-container {
margin-top: 30px;
}
#actions-container .action-icon {
width: 200px;
height: 200px;
background-color: rgb(255, 208, 4);
border-radius: 50%;
box-shadow: 5px -2px 6px 3px #0000004a;
/* center contents*/
display: flex;
justify-content: center;
align-items: center;
}
.action-icon-box{
position: relative;
}
#actions-container .action-icon-box::after,#actions-container .action-icon-box::before{
position: absolute;
content: '';
width: 300px;
height:300px;
border-radius: 50%;
z-index:-1;
top:0px;
border: 2px solid;
border-color:transparent;
}
#actions-container .action-icon-box::before{
border-right-color: green;
right: -60px;
}
#actions-container .action-icon-box::after{
border-left-color: green;
left: -60px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container" id="actions-container">
<div class="d-flex justify-content-between">
<div class="action-icon-box text-center ">
<h3 class="text-center">Title</h3>
<div class="p-1 action-icon text-center mt-4">
<img class="center" src="/Content/images/lp-homepage/microphone.png" height="100" />
</div>
</div>
</div>
</div>

Timeline indicators using CSS and HTML

I am trying to recreate this image using a combination of CSS and HTML with no luck. Please advise.
Current Code:
.lens-profile-timeline {
list-style: none;
padding: 0;
margin: 60px 0 80px;
border-bottom: 8px solid #39752c;
position: relative;
}
.lens-profile-timeline li {
position: absolute;
width: 16px;
height: 16px;
border: 13px solid #39752c;
border-radius: 16px;
background: #fff;
margin-top: -10px;
margin-left: 20px;
margin-right: 20px;
}
.lens-profile-timeline time,
.lens-profile-timeline p {
left: -27px;
top: -40px;
position: absolute;
width: 70px;
text-align: center;
}
.lens-profile-timeline time {
margin-top: 70px;
font-size: 18px;
}
.lens-profile-timeline p {
margin-top: -0px;
font-size: 10px;
line-height: 1.1;
}
.lens-profile-timeline p:after {
content: "";
height: 8px;
border-left: 1px solid #39752c;
position: absolute;
bottom: -10px;
left: 35px;
}
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-6">
<ol class="lens-profile-timeline point">
<li style="left: 0;">
<time>1970</time>
</li>
<li style="left: 45%;">
<time datetime="2003-01-01">2003</time>
</li>
<li style="right: 0;">
<time>2013</time>
<p class="hidden">Current Year</p>
</li>
</ol>
</div>
<div class="col-md-3">
</div>
</div>
Above represents the current code being used to generate the image. However you will notice there are several elements which are missing.
You can do it with a combination of pseudo elements, CSS triangles and linear-gradients.
The linear-gradient(to right, #AFCB6D, #126A38); will create a mixed background color effect.
The triangles at the end can be created using CSS triangles concept using pseudo-elements.
The indicators are created with pseudo element circles as well. The indicator text can be specified within content: " " or remove the pseudo-elements and specify the text within div for better customization.
Regular text without using CSS content:
.timeline {
width: 500px;
height: 10px;
margin: 20px;
background: linear-gradient(to right, #AFCB6D, #126A38);
position: relative;
font-family: Roboto;
}
.timeline::before,
.timeline::after {
content: " ";
position: absolute;
height: 0px;
width: 0px;
top: -5px;
}
.timeline::before {
left: -20px;
border: 10px solid #AFCB6D;
border-color: transparent #AFCB6D transparent transparent;
}
.timeline::after {
right: -20px;
border: 10px solid #126A38;
border-color: transparent transparent transparent #126A38;
}
.indicators {
position: relative;
}
.indicator-1,
.indicator-2,
.indicator-3 {
border: 5px solid #AFCB6D;
background: white;
border-radius: 50%;
width: 10px;
height: 10px;
top: -5px;
position: absolute;
}
.indicator-1 {
left: 10px;
}
.indicator-2 {
border-color: #5B9951;
left: 240px;
}
.indicator-3 {
border-color: #126A38;
left: 475px;
}
.indicator-text {
position: relative;
top: 15px;
}
.indicator-1 .indicator-text {
left: -20px;
}
.indicator-2 .indicator-text {
left: -15px;
}
.indicator-3 .indicator-text {
left: -10px;
}
<div class="timeline">
<div class="indicators">
<div class="indicator-1">
<div class="indicator-text">Standard</div>
</div>
<div class="indicator-2">
<div class="indicator-text">Better</div>
</div>
<div class="indicator-3">
<div class="indicator-text">Best</div>
</div>
</div>
</div>
Titles using content property:
.timeline {
width: 500px;
height: 10px;
margin: 20px;
background: linear-gradient(to right, #AFCB6D, #126A38);
position: relative;
font-family: Roboto;
}
.timeline::before,
.timeline::after {
content: " ";
position: absolute;
height: 0px;
width: 0px;
top: -5px;
}
.timeline::before {
left: -20px;
border: 10px solid #AFCB6D;
border-color: transparent #AFCB6D transparent transparent;
}
.timeline::after {
right: -20px;
border: 10px solid #126A38;
border-color: transparent transparent transparent #126A38;
}
.indicator {
border: 5px solid #5B9951;
background: white;
border-radius: 50%;
width: 10px;
height: 10px;
margin: 0 auto;
top: -5px;
position: relative;
}
.indicator::after {
content: "\a Best";
white-space: pre;
border: 5px solid #126A38;
background: white;
border-radius: 50%;
width: 10px;
height: 10px;
top: -5px;
left: 230px;
position: absolute;
}
.indicator::before {
content: "\a Standard";
white-space: pre;
border: 5px solid #AFCB6D;
background: white;
border-radius: 50%;
width: 10px;
height: 10px;
top: -5px;
left: -240px;
position: absolute;
}
.spacer {
margin-top: 20px;
}
<div class="timeline">
<div class="indicator">
<div class="spacer"></div>Better
</div>
</div>
It's not perfect, but using CSS 3 gradients, and changing a few numbers, you can get something pretty close to your picture (minus the arrows)
I wrapped it all up in a JSBin.
Hope this helps,
Sean

Polygon Button with pure CSS [duplicate]

This question already has answers here:
Elongated hexagon shaped button using only one element
(4 answers)
Closed 7 years ago.
I need to code a polygon button that has an outline with pure css and html. This is what I have right now but I can't figure out how to add the outline. This need to be supported in IE as well. How do I do this?
/**** CSS ***/
#statement .polygon {
width: 290px;
height: 75px;
background: #590f20;
position: relative;
color: #F94141;
text-align: center;
font-size: 1.8em;
line-height: 2.9em;
font-weight: 400;
text-transform: uppercase;
margin-top: 50px;
margin-bottom: 35px;
}
#statement .bottom:before {
content: "";
position: absolute;
top: 0;
left: -50px;
width: 0;
height: 0;
border-left: 25px solid transparent;
border-right: 25px solid #590f20;
border-bottom: 37.5px solid transparent;
}
#statement .bottom:after {
content: "";
position: absolute;
top: 0px;
left: 290px;
width: 0;
height: 0;
border-left: 25px solid #590f20;
border-right: 25px solid transparent;
border-bottom: 37.5px solid transparent;
}
#statement .top:before {
content: "";
position: absolute;
bottom: 37.5px;
left: -50px;
width: 0;
height: 0;
border-left: 25px solid transparent;
border-right: 25px solid #590f20;
border-top: 37.5px solid transparent;
}
#statement .top:after {
content: "";
position: absolute;
bottom: 37.5px;
left: 290px;
width: 0;
height: 0;
border-left: 25px solid #590f20;
border-right: 25px solid transparent;
border-top: 37.5px solid transparent;
}
<div id="statement">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="heading">
<h1></h1>
</div>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-md-3 col-md-offset-4-5">
<a class="button" href="#button">
<div class="polygon bottom top">
Work With Us
</div>
</a>
</div>
</div>
</div>
<!-- /.containter -->
</div>
<!-- /#statement -->
You can try using a css clip-path ploygon and then add another div to get a border.
#statement .polygon .outer {
display: inline-block;
width: 290px;
height: 75px;
background: #590f20;
position: relative;
color: #F94141;
text-align: center;
font-size: 1.8em;
line-height: 2.9em;
font-weight: 400;
text-transform: uppercase;
-webkit-clip-path: polygon(30px 80px, 0px 50%, 30px 0px, 260px 0px, 290px 50%, 260px 80px);
clip-path: polygon(30px 80px, 0px 50%, 30px 0px, 260px 0px, 290px 50%, 260px 80px);
-webkit-transform: scale(0.98, 0.95);
transform: scale(0.98, 0.95);
}
#statement .polygon.border {
-webkit-clip-path: polygon(30px 80px, 0px 50%, 30px 0px, 260px 0px, 290px 50%, 260px 80px);
clip-path: polygon(30px 80px, 0px 50%, 30px 0px, 260px 0px, 290px 50%, 260px 80px);
background-color: orange;
}
<div id="statement">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="heading">
<h1></h1>
</div>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-md-3 col-md-offset-4-5">
<a class="button" href="#button">
<div class="polygon border">
<span class="outer">
Work With Us
</span>
</div>
</a>
</div>
</div>
</div>
<!-- /.containter -->
</div>
<!-- /#statement -->
Whilst SVG may be an option here, I (have to) add a CSS version. Here's a quick demo, which is using a fixed height but variable width:
div {
margin: 50px;
height: 50px;
min-width: 100px;
background: lightgray;
position: relative;
display: inline-block;
border-top: 5px solid gold;
border-bottom: 5px solid gold;
padding-left: 30px;
padding-right: 30px;
line-height: 50px;
cursor:pointer;
}
div:before,
div:after {
content: "";
position: absolute;
top: -5px;
height: 37px;
width: 37px;
background: inherit;
transform: rotate(45deg);
transform-origin: top left;
}
div:before {
left: 0;
border-left: 5px solid gold;
border-bottom: 5px solid gold;
}
div:after {
left: 100%;
border-top: 5px solid gold;
border-right: 5px solid gold;
}
/*demo only*/
html {background: #222;}
<div>SOME TEXT</div>