"TEST Bootstrap Ribbons"
Bootstrap 3.1.0 Snippet by mrmccormack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!--
Ref:
-->
<div class="container">
<div class="row">
<h2>TEST Bootstrap Ribbons</h2>
</div>
<header style="padding:3em;height:auto;width:auto;margin:0;text-align:center;">
<h1 style="margin:0;padding:0;">Demo: <a style="color:#00aeef;text-decoration:none;" href="#">Pure CSS Ribbon Banner</a></h1>
</header>
<figure style="padding:0 3em;overflow:visible;">
<div class="content-box">
<a href="http://youtu.be/zJahlKPCL9g" id="ribbon" target="_blank">
<img class="" src="https://i1.ytimg.com/vi/zJahlKPCL9g/mqdefault.jpg" width="400" >
</a>
<div id="ribbon-container">
<a href="http://youtu.be/zJahlKPCL9g" id="ribbon" target="_blank">Featured YouTube</a>
</div>
</div>
</figure>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.content-box {
width: 410px;
height: 235px;
margin: 0 auto;
position: relative; /* So we can position the banner within the box */
background: gray;
border: 5px solid white;
box-shadow: 0 0 10px rgba(0,0,0,.3);
-moz-box-shadow: 0 0 10px rgba(0,0,0,.3);
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.3);
}
#ribbon-container {
position: absolute;
top: 15px;
right: -20px;
overflow: visible; /* so we can see the pseudo-elements we're going to add to the anchor */
font-size: 18px; /* font-size and line-height must be equal so we can account for the height of the banner */
line-height: 18px;
}
#ribbon-container:before {
content:"";
height: 0;
width: 0;
display: block;
position: absolute;
top: 3px;
left: 0;
border-top: 29px solid rgba(0,0,0,.3); /* These 4 border properties create the first part of our drop-shadow */
border-bottom: 29px solid rgba(0,0,0,.3);
border-right: 29px solid rgba(0,0,0,.3);
border-left: 29px solid transparent;
}
#ribbon-container:after { /* This adds the second part of our dropshadow */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: