html - CSS overlapping transparent arrow elements -



html - CSS overlapping transparent arrow elements -

is possible css? have attempted via before/after pseudo-elements, , while can work solid colors, having problem coming way transparency.

any suggestions?

if don't need black borders around each item (as can seen in posted image), still create needed shapes border follows:

class="snippet-code-css lang-css prettyprint-override">.timeline-unit:before, .timeline-unit:after { top: 0; border: solid transparent; border-width: 1.65em; height: 0; width: 0; position: absolute; pointer-events: none; } .timeline-unit:after { content: " "; left: 100%; border-left-color: rgba(51, 51, 51, 0.8); } .timeline-unit { position: relative; display: inline-block; background: rgba(51,51,51,.8); padding: 1em; line-height: 1.25em; color: #fff; } .timeline-unit:before { content: none; } .timeline-unit + .timeline-unit:before { content: " "; border-color: rgba(51, 51, 51, 0.8); border-left-color: transparent; border-right: 0; right: 100%; } .timeline-unit + .timeline-unit { margin-left: 2em; } /************** d e m o **************/ body { background: red; -webkit-animation: bgcolor 4s linear 0s infinite alternate; -moz-animation: bgcolor 4s linear 0s infinite alternate; -o-animation: bgcolor 4s linear 0s infinite alternate; animation: bgcolor 4s linear 0s infinite alternate; } @-webkit-keyframes bgcolor { { background: red; } { background: green; } } @-moz-keyframes bgcolor { { background: red; } { background: green; } } @-o-keyframes bgcolor { { background: red; } { background: green; } } @keyframes bgcolor { { background: red; } { background: green; } } class="snippet-code-html lang-html prettyprint-override"><div class="timeline-unit"> timeline 1 </div> <div class="timeline-unit"> timeline 2 </div> <div class="timeline-unit"> timeline 3 </div>

however if need add together border on each item, there 2 options:

using drop-shadow() filter false border - example here (supported in webkit/firefox35+). using css transforms in order create css shapes, border unused , available later usages (supported in ie9+ well).

html css css-shapes

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -