admin管理员组文章数量:1399013
I'm looking for CSS3 code for the ribbon as below, please?
This is what it should look like this and size width 30px and height 44px: I don't have any code to offer for sample or something to work from e.g JS fiddles.
align top .png
I've seen this /
But it is horizontally. I'm looking for vertical like the above.
UPDATE Monday, 10 December 2.30pm: @Zoltan Toth - I've included a JS Fiddle on ments as below. (I'm not allowed to post JS fiffles here).
I'm looking for CSS3 code for the ribbon as below, please?
This is what it should look like this and size width 30px and height 44px: I don't have any code to offer for sample or something to work from e.g JS fiddles.
align top http://www.kerrydeaf./pink.png
I've seen this http://css-tricks./snippets/css/ribbon/
But it is horizontally. I'm looking for vertical like the above.
UPDATE Monday, 10 December 2.30pm: @Zoltan Toth - I've included a JS Fiddle on ments as below. (I'm not allowed to post JS fiffles here).
Share Improve this question edited Dec 10, 2012 at 14:33 Irishgirl asked Dec 8, 2012 at 21:06 IrishgirlIrishgirl 7513 gold badges14 silver badges23 bronze badges3 Answers
Reset to default 9You can try something like this - DEMO
HTML
<div> i </div>
CSS
div {
background: deeppink;
height: 30px;
width: 30px;
position: relative;
text-align: center;
font: 600 16px sans-serif;
color: white;
line-height: 27px;
border: 0;
}
div:after {
content: "";
position: absolute;
bottom: -18px;
left: 0;
height: 0;
width: 0;
border: solid 15px deeppink;
border-bottom-color: transparent;
}
div:hover {
background: purple;
}
div:hover:after {
border-color: purple;
border-bottom-color: transparent;
}
Put it inside a DIV, then in the div do this:
div
{
transform:rotate(90deg);
-ms-transform:rotate(90deg); /* IE 9 */
-moz-transform:rotate(90deg); /* Firefox */
-webkit-transform:rotate(90deg); /* Safari and Chrome */
-o-transform:rotate(90deg); /* Opera */
}
Or you can use Canvas for that and drawn however you want, and don't need that CSS2 tricks to do that.
Vertical banner with slanted bottom
<div class="verticalbanner"></div>
.verticalbanner {
background: #e22692; //ribbon color
height: 44px; // ribbon height
width: 30px; // ribbon width
}
.verticalbanner:after,.verticalbanner:before {
content: '';
position: absolute;
border-top: 20px solid #e22692; // angle degree, reduce to reduce degree of angles
height: 0; // no height, no content, just border
width: 0;
top: 100%;
}
.verticalbanner:after { // right angle
border-left: 25px solid transparent;
right:0;
}
.verticalbanner:before { // left angle
border-right: 25px solid transparent;
left:0;
}
jsFiddle (link)
本文标签: javascriptCSS3 vertical RibbonStack Overflow
版权声明:本文标题:javascript - CSS3 vertical Ribbon - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744108093a2591159.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论