css3 - Crawler Friendly CSS Ribbons -


i have working 'css ribbon tag'

however, html ugly:

          <div class="tag-holder">               <div style="position:relative">                 <div class="triangle">                         <span>classic</span>                 </div>               </div>               <div style="position:relative">                 <div class="triangle">                         <span>open-assets</span>                 </div>               </div>               <div style="position:relative">                 <div class="triangle">                         <span>open-music</span>                 </div>               </div>           </div>         </div> 

in have define 'tags' wrapped 2 divs wrapped tag-holder div. problematic crawlers/screen readers hard read.

what css use have minimal html markup still produce same look? i'm thinking uses :before or such psuedoselector work i'm not sure how implement it.

i'm looking non-js solution, , preferably, works on browsers.

try this: http://jsfiddle.net/t5yma/

html:

<div class="tag_holder">     <div class="ribbon">classic</div>     <div class="ribbon">open-assets</div>     <div class="ribbon">classic</div> </div> 

css:

.ribbon {   position:relative;   width: 80px;   height: 30px;   background-color: #5ad2f0;   text-align: left;   border-radius: 5px 0px 0px 5px;    margin:5px 0;   color:white;   font-weight:bold;   font-size:12px;   padding-left: 20px;    } .ribbon:after {   content: "";   position: absolute;   left: 100%;   display: inline-block;   width: 0;    height: 0;    border-top: 15px solid transparent;   border-bottom: 15px solid transparent;   border-left: 16px solid #5ad2f0; } .ribbon:before {   content: "";   position: absolute;   bottom: -14px;   left:1px;   display: inline-block;   width: 0;    height: 0;    border-top: 15px solid transparent;   border-bottom: 15px solid transparent;   border-right: 16px solid #3aacc9;   z-index:-1 } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -