css - 如何创建一个三 Angular 形的可点击div?

标签 css

我正在尝试创建一个像 div 这样的三 Angular 形可点击按钮,附图中是我真正想要实现的。 image

这是我到目前为止所达到的,JsFiddle

HTML:

 <div class="input"><</div>

CSS:

body {padding:40px;}

.input {   
text-decoration:none;
padding:5px 10px;    
background:#117ebb;
font-size:9px;
color:#fff;
border-radius:5.5px 0px 0px 5px;
box-shadow:  0px 5px 3px #003355;
position:relative;
width:1px;
height:12px;
}

.input:after {
position:absolute;
top:0px;
left:-10px;
content:" ";
width: 0;
height: 0px;
border-top: 13px solid transparent;
border-bottom: 13px solid transparent;
border-right:13px solid #117ebb;
border-radius:0px 0px 0px 20px; 
}

最佳答案

css 纯三 Angular 形和 jquery 你可以添加点击事件:

html

<div class="input"></div>

j查询

$(document).ready(function(){
    $(".input").click(function(){
        alert('hello arrow');        
    });
});

CSS

body {padding:40px;}
.input{
    width: 0; 
    height: 0; 
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent; 

    border-right:10px solid blue; 
    cursor: pointer;
}

http://jsfiddle.net/TvJ6t/

关于css - 如何创建一个三 Angular 形的可点击div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15231266/

相关文章:

html - 为什么在没有页面刷新的情况下更新下拉列表时 CSS 不起作用

html - Bootstrap 中菜单项的圆 Angular 边缘

jquery - 如何让我的密码验证器工作?

html - CSS "Display: none;"属性

html - 重叠的导航栏 css

css - 如何使用 border-radius 制作平滑的线性渐变条纹

css - 如何在 Bootstrap 下拉菜单上给用户更多时间?

html - 如何创建适用于大多数/所有浏览器的渐变背景?

css - FF 'Responsive Design View' 和视网膜

jquery - 使用jquery从右向左滑动内容