2
A
回答
4
您可以先用border-radius
创建矩形,然后用:after
添加三角形伪元素。
.shape {
width: 200px;
height: 50px;
background: #B67025;
margin: 50px;
border-radius: 25px;
position: relative;
}
.shape:after {
content: '';
position: absolute;
border-style: solid;
right: 0;
top: 50%;
border-width: 10px 0 10px 10px;
transform: translate(80%, -50%);
border-color: transparent transparent transparent #B67025;
}
<div class="shape"></div>
2
看:https://css-tricks.com/examples/ShapesOfCSS/
这里“E的代码:
#talkbubble {
width: 120px;
height: 80px;
background: red;
position: relative;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin: 50px
}
#talkbubble:before {
content:"";
position: absolute;
right: 100%;
top: 26px;
width: 0;
height: 0;
border-top: 13px solid transparent;
border-right: 26px solid red;
border-bottom: 13px solid transparent; }
<div id="talkbubble"></div>
0
外加与@Nenad Vracar区
这里给出的解决方案是做同样的另一种方式,在理解CSS属性可能会有所帮助。
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
.main-div {
position: relative;
}
.first {
width: 150px;
height: 50px;
background: #B67025;
border-radius: 25px 0 0 25px;
float: left;
position: absolute;
top: 0;
}
.second {
width: 50px;
height: 50px;
background: #B67025;
border-radius: 0 25px 25px 0;
float: left;
position: absolute;
left: 150px;
}
.third {
position: absolute;
left: 197px;
top: 15px;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 10px solid #B67025;
}
</style>
</head>
<body>
<div class="main-div">
<div class="first">
</div>
<div class="second">
</div>
<div class="third">
</div>
</div>
</body>
</html>
1
SVG
创建复杂的形状很容易用SVG做那么CSS:
svg {
/*For demonstration only*/
border: 1px solid black;
}
<svg width="300px" viewBox="0 0 200 100">
<path d="m50,10 95,0
a40 40 0 0 1 40,30
l10,10
l-10,10
a40 40 0 0 1 -40,30
h-95 a1 1 0 0 1 0,-80z" fill="rgb(182, 112, 37)"/>
</svg>
相关问题
- 1. 我怎样才能复制这与CSS?
- 2. 我怎样才能使用CSS只有这样的背景?
- 3. 我怎样才能让这样的使用CSS和DIV
- 4. 我怎样才能有CSS的背景形状?
- 5. 我怎样才能使CSS或JavaScript
- 6. 这是什么形状,我怎样才能实现它使用CSS?
- 7. 我怎样才能让这个长方形帆布一样锋利的CSS DIV
- 8. 我怎样才能做到这一点与CSS和/或JavaScript?
- 9. 我怎样才能缩短与SASS这个CSS?
- 10. 我怎样才能用CSS冻结THEAD?
- 11. 我怎样才能让CSS动画
- 12. 我怎样才能使这个CSS边界属性一班?
- 13. 我怎样才能让这样的
- 14. 我怎样才能把我的CSS后挂钩CSS?
- 15. 我怎样才能找出什么CSS重写我的样式表中的CSS?
- 16. 我怎样才能改变这与jquery?
- 17. 我怎样才能实现这与jQuery?
- 18. 我怎样才能达到这个布局的CSS
- 19. 我怎样才能做到这一点的CSS网格
- 20. 我怎样才能得到这个CSS规则工作?
- 21. 我怎样才能点击与CSS动画的div?
- 22. 我怎样才能使这个代码
- 23. 我怎样才能排除悬停效果与CSS
- 24. 我怎样才能做一个css类与其他
- 25. 我怎样才能CSS列表/网格与边界div?
- 26. 我怎样才能让jQuery printElement打印一个div与CSS类?
- 27. 我怎样才能随意使用jQuery的CSS属性的值?
- 28. 我怎样才能
- 29. 我怎样才能
- 30. 我怎样才能
,那么你就可以得出一个影子周围泡影http://codepen.io/gc-nomade/pen/amGjqw –