CSS Arrows with borders - html

I found this codepen demo which almost does what I need (http://codepen.io/web-tiki/pen/EaKPMK).
HTML:
<div class="wrap">
<div class="arrow"></div>
</div>
CSS:
.wrap {
position: relative;
height:150px;
overflow: hidden;
width: 70%;
margin: 0 auto;
}
.wrap img {
width: 100%;
height: auto;
display: block;
}
.arrow {
position: absolute;
bottom: 0;
width: 100%;
padding-bottom:3%;
background-color: rgba(0, 0, 0, 0.8);
}
.arrow:before, .arrow:after {
content:'';
position: absolute;
bottom: 100%;
width: 100%;
padding-bottom:inherit;
background-color: inherit;
}
.arrow:before {
right: 20%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
transform: skewX(75deg);
}
.arrow:after {
left: 80%;
-ms-transform-origin: 0 100%;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
transform: skewX(-75deg);
}
The only thing that's missing is, that I actually need a border around the box. When I add borders to the pseudo elements, the skewed part doesn't produce a closed line.
.arrow:before {
right: 20%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
transform: skewX(75deg);
border-top: 4px solid #df0000;
border-right: 30px solid #df0000;
}
.arrow:after {
left: 80%;
-ms-transform-origin: 0 100%;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
transform: skewX(-75deg);
border-top: 4px solid #df0000;
border-left: 30px solid #df0000;
}
Any Ideas how to make this work?

This is my solution, although it inserts a new element: <div class="arrow-head">
.wrap {
position: relative;
height:150px;
overflow: hidden;
width: 70%;
margin: 0 auto;
}
.wrap img {
width: 100%;
height: auto;
display: block;
}
.arrow {
position: absolute;
bottom: 0;
width: 100%;
padding-bottom:3%;
background-color: rgba(0, 0, 0, 0.8);
}
.arrow:before, .arrow:after {
content:'';
position: absolute;
bottom: 100%;
width: 100%;
padding-bottom:inherit;
background-color: inherit;
}
.arrow:before {
right: 20%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
transform: skewX(75deg);
border-top: 4px solid #df0000;
border-right: 30px solid #df0000;
}
.arrow:after {
left: 80%;
-ms-transform-origin: 0 100%;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
transform: skewX(-75deg);
border-top: 4px solid #df0000;
border-left: 30px solid #df0000;
}
.arrow-head {
position: absolute;
right: -moz-calc(20% - 30px);
right: webkit-calc(20% - 30px);
right: -o-calc(20% - 30px);
right: calc(20% - 30px);
width: 0;
height: 0;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
border-top: 8px solid #df0000;
}
<div class="wrap">
<div class="arrow">
<div class="arrow-head">
</div>
</div>
</div>

here is one way.i think this is what you are looking for
.arrow:before {
right: 20%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 70%;
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
transform: skewX(75deg);
border-top: 4px solid #df0000;
border-right: 30px solid #df0000;
}
.arrow:after {
left: 80%;
-ms-transform-origin: 0 100%;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
transform: skewX(-75deg);
border-top: 4px solid #df0000;
border-left: 30px solid #df0000;
}

you need to decrease the value of the pseudo elements like-
.arrow:after {left:49%}
so your code will be look like-
.wrap {
position: relative;
height:150px;
overflow: hidden;
width: 70%;
margin: 0 auto;
}
.wrap img {
width: 100%;
height: auto;
display: block;
}
.arrow {
position: absolute;
bottom: 0;
width: 100%;
padding-bottom:3%;
background-color: rgba(0, 0, 0, 0.8);
}
.arrow:before, .arrow:after {
content:'';
position: absolute;
bottom: 100%;
width: 50%;
padding-bottom:inherit;
background-color: inherit;
}
.arrow:before {
right: 50%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
transform: skewX(45deg);
border-right:10px solid red;
border-top:10px solid red;
}
.arrow:after {
left: 49%;
-ms-transform-origin: 0 100%;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
transform: skewX(-45deg);
border-left:10px solid red;
border-top:10px solid red;
}
it will look like this -

I came up with this solution:
html:
<div class="bar left"></div><!--
--><div class="arrow-outer">
<div class="square left"></div>
<div class="square right"></div>
<div class="border left"></div>
<div class="border right"></div>
</div><!--
--><div class="bar right"></div>
css:
*{
box-sizing: border-box;
}
.bar{
position: relative;
vertical-align: top;
width: 200px;
height: 35px;
display: inline-block;
background-color: #dfdfdf;
border-top: 4px solid #ff0000;
}
.arrow-outer{
display: inline-block;
vertical-align: top;
width: 100px;
height: 35px;
position: relative;
overflow: hidden;
}
.square{
position: absolute;
width: 100px;
height: 100px;
top: 0;
background-color: #dfdfdf;
}
.square.left{
transform-origin:left top;
left: 0;
transform: rotate(30deg);
}
.square.right{
transform-origin:right top;
right: 0;
transform: rotate(-30deg);
}
.border{
width: 58px;
height: 4px;
background-color: #ff0000;
position: absolute;
top: 0;
}
.border.left{
transform-origin:left top;
left: 0;
transform: rotate(30deg) skewX(30deg);
}
.border.right{
transform-origin:right top;
right: 0;
transform: rotate(-30deg) skewX(-30deg);
}
Here's the codepen:
http://codepen.io/swissdoode/pen/OpzEaJ
The only problem is, that the «fake» border doesn't really line up to the other borders because of the rotate and skewX. It's barely visible, though...
Thoughts?

Related

How to create an arrow shape after an element with :after

I created a hexagon with css which is working well. Now, I am attempting to create somewhat of an arrow to set under the hexagon. In my attempt, I used the pseudo element, :after to try to position the line after the hexagon. For some reason the line is appearing at the top of the hexagon.
This leads me to the next issue, outside of the placement. How would I create an arrow type line (see illustration below) with :after. Is it even possible?
Is there a better way to do this?
#hexGrid {
width: 60%;
position: absolute;
margin: 0 auto;
padding: 0;
right: 5%;
top: 35%;
}
#hexGrid li {
list-style-type: none;
position: relative;
float: right;
width: 27.85714285714286%;
padding: 0 0 32.16760145166612% 0;
-o-transform: rotate(-60deg) skewY(30deg);
-moz-transform: rotate(-60deg) skewY(30deg);
-webkit-transform: rotate(-60deg) skewY(30deg);
-ms-transform: rotate(-60deg) skewY(30deg);
transform: rotate(-60deg) skewY(30deg);
overflow: hidden;
visibility: hidden;
}
#hexGrid li * {
visibility: visible;
}
#hexGrid li .hexagon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #2f2f2f;
-o-transform: skewY(-30deg) rotate(60deg);
-moz-transform: skewY(-30deg) rotate(60deg);
-webkit-transform: skewY(-30deg) rotate(60deg);
-ms-transform: skewY(-30deg) rotate(60deg);
transform: skewY(-30deg) rotate(60deg);
overflow: hidden;
}
.hexagon:after {
content: '';
position: relative;
display: block;
margin-top: 10px;
width: 50%;
height: 3px;
background: #b82222;
}
<ul id="hexGrid">
<li>
<div class="hexagon">
</div>
</li>
</ul>
Here is how you would change the size of hexagon:
#container {
margin: 50% auto 0;
width: 300px;
height: 300px;
padding: 2px;
border: 1px solid;
transform: translate( 0, -50%)
}
#container>div {
transform: scale(2) translate(50%, 50%);
}
#chevron {
margin-top: 40%;
position: relative;
text-align: center;
padding: 0;
/* try to add more padding and see the difference*/
margin-bottom: 6px;
height: 5px;
width: 100px;
}
#chevron:before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 50%;
background: red;
transform: skew(0deg, 28deg);
}
#chevron:after {
content: '';
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 50%;
background: red;
transform: skew(0deg, -28deg);
}
#hexagon {
width: 100px;
height: 55px;
background: #616161;
position: relative;
margin-top: 50px;
}
#hexagon:before {
content: "";
position: absolute;
top: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 25px solid #616161;
}
#hexagon:after {
content: "";
position: absolute;
bottom: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 25px solid #616161;
}
<div id="container">
<div id="hexagon"></div>
<div id="chevron"></div>
</div>
SVG will be the best solution for this problem.. But still if you want it with CSS, you can create 3 Hexagons and overlap it at 10px gap.
Snippet below:
#hexGrid {
width: 60%;
position: absolute;
margin: 0 auto;
padding: 0;
right:5%;
top: 35%;
}
#hexGrid li {
list-style-type: none;
position: absolute;
width: 27.85714285714286%;
padding: 0 0 32.16760145166612% 0;
-o-transform: rotate(-60deg) skewY(30deg);
-moz-transform: rotate(-60deg) skewY(30deg);
-webkit-transform: rotate(-60deg) skewY(30deg);
-ms-transform: rotate(-60deg) skewY(30deg);
transform: rotate(-60deg) skewY(30deg);
overflow: hidden;
visibility: hidden;
}
#hexGrid li:nth-child(2){
top:-10px;
}
#hexGrid li:nth-child(2) .hexagon{
background: #fff;
}
#hexGrid li:nth-child(3){
top:-20px;
}
#hexGrid li * {
visibility: visible;
}
#hexGrid li .hexagon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #2f2f2f;
-o-transform: skewY(-30deg) rotate(60deg);
-moz-transform: skewY(-30deg) rotate(60deg);
-webkit-transform: skewY(-30deg) rotate(60deg);
-ms-transform: skewY(-30deg) rotate(60deg);
transform: skewY(-30deg) rotate(60deg);
overflow: hidden;
}
<ul id="hexGrid">
<li>
<div class="hexagon">
</div>
</li>
<li>
<div class="hexagon white">
</div>
</li>
<li>
<div class="hexagon arrow">
</div>
</li>
</ul>
Again, I would prefer SVG over this solution.
Here's another way of doing that
#chevron {
margin-top: 25px;
position: relative;
text-align: center;
padding: 0; /* try to add more padding and see the difference*/
margin-bottom: 6px;
height: 5px; /* change this to make it bigger */
width: 100px;
}
#chevron:before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 50%;
background: red;
transform: skew(0deg, 28deg);
}
#chevron:after {
content: '';
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 50%;
background: red;
transform: skew(0deg, -28deg);
}
#hexagon {
width: 100px;
height: 55px;
background: #616161;
position: relative;
margin-top: 50px;
}
#hexagon:before {
content: "";
position: absolute;
top: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 25px solid #616161;
}
#hexagon:after {
content: "";
position: absolute;
bottom: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 25px solid #616161;
}
<div id="hexagon"></div>
<div id="chevron"></div>

Hover on parent to trigger transform property

I am attempting to use a hover effect to transform my second arrow #arrowDown2 to go down to show both arrows. I am wanting the hover to trigger on arrowDownWrap.
What am I doing wrong?
#blue {
width: 100%;
height: 300px;
background: blue;
}
#arrowDownWrap {
position: absolute;
bottom: 120px;
left: 50%;
-webkit-transform: translate(-50%,0);transform: translate(-50%,0);
cursor: pointer;
}
#arrowDownWrapInner {
position: relative;
bottom: 40px;
}
#arrowDown, #arrowDown2 {
border: solid #FFF;
border-width: 0 3px 3px 0;
width: 25px;
height: 25px;
display: block;
padding: 3px;
-webkit-transform: rotate(45deg);transform: rotate(45deg);
position: absolute;
top: 0;
left: 0;
}
#arrowDownWrap:hover #arrowDown2 {
-webkit-transform: rotate(45deg), translate(0, 40px);transform: rotate(45deg), translate(0, 40px);
}
<div id="blue">
<div id="arrowDownWrap">
<div id="arrowDownWrapInner">
<i id="arrowDown"></i>
<i id="arrowDown2"></i>
</div>
</div>
</div>
To specify multiple CSS transform properties, no comma is necessary.
Just list them one after another.
For example:
transform: rotate(45deg) translate(0, 40px);
Working example:
#blue {
position: relative;
width: 100%;
height: 150px;
background: blue;
}
#arrowDownWrap {
position: absolute;
bottom: 100px;
left: 50%;
-webkit-transform: translate(-50%, 0);
transform: translate(-50%, 0);
cursor: pointer;
}
#arrowDownWrapInner {
position: relative;
bottom: 20px;
}
#arrowDown,
#arrowDown2 {
border: solid #FFF;
border-width: 0 3px 3px 0;
width: 25px;
height: 25px;
display: block;
padding: 3px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
top: 0;
left: 0;
background-color: red;
}
#arrowDownWrap:hover #arrowDown2 {
-webkit-transform: translate(0, 50px) rotate(45deg);
transform: translate(0, 50px) rotate(45deg);
}
<div id="blue">
<div id="arrowDownWrap">
<div id="arrowDownWrapInner">
<i id="arrowDown"></i>
<i id="arrowDown2"></i>
</div>
</div>
</div>

create a responsive triangle

I'm trying to set two triangles in the following way:
The two triangles have to go from the middle to the outside of the browser. I tried to set it up with a wrapper and a background-color and then rotate the wrapper, but I cant get it responsive. The code I tried was:
#page-header-wrapper-triangle {
background-color:#e14b41 ;
-webkit-transform: rotate(-12deg) translate3d(0, 0, 0);
-moz-transform: rotate(-12deg);
-o-transform: rotate(-12deg);
-ms-transform: rotate(-12deg);
transform: rotate(-12deg);
margin: 0 -21px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
-ms-transform-origin: left center;
transform-origin: left center;
-webkit-backface-visibility: hidden;
outline: 1px solid transparent;
position: relative;
min-height: 204px;
z-index:1000;
width:80%;
}
#page-header-wrapper-triangle-2 {
background-color:#e14b41 ;
-webkit-transform: rotate(12deg) translate3d(0, 0, 0);
-moz-transform: rotate(12deg);
-o-transform: rotate(12deg);
-ms-transform: rotate(12deg);
transform: rotate(12deg);
margin: 0 -54px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
-ms-transform-origin: left center;
transform-origin: left center;
-webkit-backface-visibility: hidden;
outline: 1px solid transparent;
position: relative;
min-height: 204px;
z-index:1000;
width:80%;
float:right;
top:-520px;
}
<div id="page-header-wrapper-triangle">
<div class="container">
<div class="row">
<div class="right-red col-xs-12 col-sm-6">
</div>
<div class="left-blue col-xs-12 col-sm-6">
</div>
</div>
</div>
</div>
<div id="page-header-wrapper-triangle-2">
<div class="container">
<div class="row">
<div class="right-red col-xs-12 col-sm-6">
</div>
<div class="left-blue col-xs-12 col-sm-6">
</div>
</div>
</div>
</div>
This works when the width of the browser is 1920 px, but s soon as I change the width it doesn't work. I got no clue how I can get this responsive.
I also tried it with background pictures. But this also doesn't work.
You can do it with pseudo selectors :after. It's responsive-ready only for some small and mid widths. But you can easily customize with media queries and change the top and height value.
There is a live example using SCSS
.header {
background-color: grey;
padding-bottom: 60px;
padding-top: 60px;
position: relative;
display: inline-block;
width: 100%;
}
.header .block-left {
float: left;
width: 50%;
}
.header .block-left:after {
background-color: red;
content: ' ';
left: 0;
top: -125px;
height: 200px;
position: absolute;
transform: skew(0deg, -15deg);
width: 50%;
z-index: 20;
}
.header .block-right {
float: right;
width: 50%;
}
.header .block-right:after {
right: 0;
background-color: yellow;
content: ' ';
top: -125px;
height: 200px;
position: absolute;
transform: skew(0deg, 15deg);
width: 50%;
z-index: 20;
}
<div class="header">
<div class="block-left"></div>
<div class="block-right"></div>
</div>
Here's a explanation of how css triangles works : http://codepen.io/chriscoyier/pen/lotjh
#import url(http://fonts.googleapis.com/css?family=Andika);
$stepTiming: 0.8s 0.2s;
.triangle-demo {
width: 100px;
height: 100px;
margin: 0 auto;
background: tan;
border-top: 0 solid #EE7C31;
border-left: 0 solid #F5D97B;
border-bottom: 0 solid #D94948;
border-right: 0 solid #8DB434;
transition: $stepTiming;
.step-1 & {
border-top-width: 10px;
}
.step-2 & {
border-left-width: 10px;
}
.step-3 & {
border-right-width: 10px;
}
.step-4 & {
border-bottom-width: 10px;
}
.step-6 & {
background: transparent;
}
.step-7 & {
width: 0; height: 0;
}
.step-8 & {
border-left-color: transparent;
}
.step-9 & {
border-right-color: transparent;
}
.step-10 & {
border-top-color: transparent;
}
}
.triangle-title {
width: 300px;
padding: 1rem;
color: white;
background: #D94948;
border-radius: 20px;
margin: auto;
opacity: 0;
transition: $stepTiming;
.step-11 & {
opacity: 1;
}
}
body {
background: #333;
font-family: 'Andika', sans-serif;
color: white;
text-align: center;
font-size: large;
transform: translateZ(0);
}
.steps {
position: relative;
height: 45px;
> div {
position: absolute;
top: 0;
left: 0;
width: 100%;
opacity: 0;
background: #333;
transition: 0.3s;
}
.step-0 {
opacity: 1;
}
.step-1 & .step-1 {
opacity: 1;
}
.step-2 & .step-2 {
opacity: 1;
}
.step-5 & .step-5 {
opacity: 1;
}
.step-6 & .step-6 {
opacity: 1;
}
.step-7 & .step-7 {
opacity: 1;
}
.step-8 & .step-8 {
opacity: 1;
}
.step-11 & .step-11 {
opacity: 1;
}
}
h1 {
text-transform: uppercase;
letter-spacing: 1px;
font-size: 1.5rem;
border-bottom: 1px solid #555;
color: #999;
}
FYI http://1stwebdesigner.com/css-shapes/

Rotating a div from the top left, transform-origin isn't working

I am trying to simulate n amount of boxes rotating from the bottom-right position of the preposition div.
So, basically, I want the top left absolute position of n, be the same as the bottom right absolute position of n - 1. I really hope I explained this well enough, I just don't want there to be a gap, and want the boxes to rotate from the top left without moving to the right or to the bottom.
I tried adding transform-origin: 0 0; but it still won't work.
I appreciate any help, thank you in advance.
Here is the CSS:
.con {
margin: 50px;
width: 100px;
clear: both;
position: relative;
}
.box:nth-child(5) {
width: 150px;
height: 150px;
outline: 1px solid black;
margin-left: -15px;
margin-top: -15px;
position: absolute;
transform-origin: 0 0;
transform: translate(140px, 140px) rotate(10deg);
}
.box:nth-child(4) {
width: 120px;
height: 120px;
outline: 1px solid black;
margin-left: 138px;
margin-top: 138px;
position: absolute;
transform-origin: 0 0;
transform: translate(110px, 110px) rotate(10deg);
}
.box:nth-child(3) {
width: 90px;
height: 90px;
outline: 1px solid black;
margin-left: 261px;
margin-top: 261px;
position: absolute;
transform-origin: 0 0;
transform: translate(80px, 80px) rotate(10deg);
}
.box:nth-child(2) {
width: 60px;
height: 60px;
outline: 1px solid black;
margin-left: 354px;
margin-top: 354px;
position: absolute;
transform-origin: 0 0;
transform: translate(50px, 50px) rotate(10deg);
}
.box:nth-child(1) {
width: 30px;
height: 30px;
outline: 1px solid black;
margin-left: 417px;
margin-top: 417px;
position: absolute;
transform-origin: 0 0;
transform: translate(20px, 20px) rotate(10deg);
}
And the HTML
<div class='con'>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
<div class='box'></div>
</div>
This is what it looks like now:
And here is the the codepen where you can see the sandbox live.
I assume this is what you are after.
View the link for the code to make sence.
http://codepen.io/anon/pen/bppRBx?editors=1111
.con {
margin: 50px;
width: 100px;
clear: both;
position: relative;
}
.box:nth-child(5) {
width: 150px;
height: 150px;
outline: 1px solid black;
margin-left: 0px;
margin-top: 0px;
position: absolute;
transform-origin: 0 0;
transform: rotate(0deg);
}
.box:nth-child(4) {
width: 120px;
height: 120px;
outline: 1px solid black;
margin-left: 149.99962px;
margin-top: 149.99962px;
position: absolute;
transform-origin: 0 0;
transform: rotate(-10deg);
}
.box:nth-child(3) {
width: 90px;
height: 90px;
outline: 1px solid black;
margin-left: 289.01398px;
margin-top: 247.33853px;
position: absolute;
transform-origin: 0 0;
transform: rotate(-20deg);
}
.box:nth-child(2) {
width: 60px;
height: 60px;
outline: 1px solid black;
margin-left: 404.36784px;
margin-top: 301.12891px;
position: absolute;
transform-origin: 0 0;
transform: rotate(-30deg);
}
.box:nth-child(1) {
width: 30px;
height: 30px;
outline: 1px solid black;
margin-left: 486.32916px;
margin-top: 323.09038px;
position: absolute;
transform-origin: 0 0;
transform: rotate(-40deg);
}
To calculate the start point of each new rectangle you need to use some trigonmetry to calculate the end position of the last one. Since this is not included in SASS/CSS you have to write your own functions.
Daniel Perez Alvarez did a nice blog post on how to create simmplified versions of COS/SIN functions in SASS:
https://unindented.org/articles/trigonometry-in-sass/
use css attribute 'transform':
.your-class:hover {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transition: transform 0.8s ease;
-webkit-transition: -webkit-transform 0.8s ease;
-moz-transition: -moz-transform 0.8s ease;
-o-transition: -o-transform 0.8s ease;
}

Add pointer to the bottom of a div as a continuation of its background image

I'm looking for a way to stack divs, with a pointer leading into the next div that is a continuation of the previous div's background image.
I've looked around and I've seen some options, but in all of them the bottom div has to be a solid color.
For example: http://jsfiddle.net/nhqKb/
#container{
height: 300px;
background: url('http://farm8.staticflickr.com/7358/9532233404_58763bd668_b.jpg') no-repeat;
position: relative;
}
#one {
position: absolute;
width: 100px;
left: 0;
bottom: 0;
border-bottom: 20px solid green;
border-right: 20px solid transparent;
}
#two {
position: absolute;
left: 120px;
bottom: 0;
right: 0;
border-bottom: 20px solid green;
border-left: 20px solid transparent;
}
<div id="container">
<div id="one"></div>
<div id="two"></div>
</div>
Is there any way to implement this using divs with background images instead of solid colors?
You can use skewX and pseudo elements to make this.
#container {
background: url('https://images.unsplash.com/photo-1440635592348-167b1b30296f?ixlib=rb-0.3.5&q=80&fm=jpg&w=1080&fit=max&s=a029f986631f264fdbc8c0272cab9c40') no-repeat;
height: 300px;
position: relative;
overflow: hidden;
}
#one {
background-color: rgba(0, 0, 0, 0.3);
bottom: 0;
left: 0;
padding-bottom: 15px;
position: absolute;
width: 100%;
}
#one:before,
#one:after {
background-color: inherit;
bottom: 100%;
content: '';
padding-bottom: inherit;
position: absolute;
width: 50%;
}
#one:before {
right: 50%;
-ms-transform-origin: 100% 100%;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
transform: skewX(45deg);
}
#one:after {
left: 50%;
-ms-transform-origin: 0 100%;
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
transform: skewX(-45deg);
}
HTML code:
<div id="container">
<div id="one"></div>
</div>