如何使三角形在纯css中的div之前? [英] How to make triangle shape in before a div in pure css?
本文介绍了如何使三角形在纯css中的div之前?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友我已经尝试了很多次,但是我不成功比请帮助我
Hello friends I have tried many times but I am not successful than please help me
我想这下面的图片像这样
I want to this below images as like this
>
现在我已经创建了这个,但是没有创建这个div的右边现在任何正文请帮助我
now i have created this but not created right corner of this div now any body please help me
我的代码是
Css
.dashbord a {
display:block;
line-height:28px;
padding-left:8px;
font-family: 'LatoRegular';
font-size:14px;
color:#58544e;
max-width:300px;
text-shadow:1px 0 0 rgba(241,236,231,1);
}
.dashbord .active{
background: #b43720; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMTAwJSIgeDI9IjEwMCUiIHkyPSIwJSI+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjYjQzNzIwIiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U5NDU0MSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(90deg, #b43720 0%, #e94541 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#b43720), color-stop(100%,#e94541)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(90deg, #b43720 0%,#e94541 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(90deg, #b43720 0%,#e94541 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(90deg, #b43720 0%,#e94541 100%); /* IE10+ */
background: linear-gradient(90deg, #b43720 0%,#e94541 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b43720', endColorstr='#e94541',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
box-shadow:1px 0 0 0 rgba(230,227,223,1), 0px -3px 0 0 rgba(153,40,19,1) inset;
text-shadow:1px 0 0 rgba(153,40,19,1);
color:#fff;
border-radius:5px 0 0 5px;
line-height:30px;
position:relative;
margin-left:-4px;
}
.dashbord .active:after{
content:'';
position:absolute;
right:-9px;
top:0;
bottom:0;
border-bottom: 15px solid transparent;
border-left: 9px solid #b43720;
border-top: 15px solid transparent;
}
HTML
<div class="dashbord">
<a href="#" class="active">Co-Workers</a>
</div>
Jsfiddle链接此处 http://jsfiddle.net/TBB9S/
Jsfiddle link here http://jsfiddle.net/TBB9S/
推荐答案
p>
Write like this:
.dashbord .active:after{
content:'';
position:absolute;
right:-11px;
top:3px;
z-index:-1;
width:22px;
height:22px;
background:green;
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
transform:rotate(45deg);
box-shadow:-3px 0 0 0 rgba(153,40,19,1) inset;
background: -moz-linear-gradient(left top, #e94541 0%,#b43720 100%);
background: -webkit-linear-gradient(left top, #e94541 0%,#b43720 100%);
background: linear-gradient(left top, #e94541 0%,#b43720 100%);
}
检查此 http://jsfiddle.net/TBB9S/2/
这篇关于如何使三角形在纯css中的div之前?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文