css - 使用 CSS 重现图像形状

标签 css css-shapes

我正在尝试仅使用 css 重现此图像

enter image description here

我玩过 radius 属性,但正如您将看到的,我没有得到相同的 Angular 效果。

.shape{
background-color: black;
opacity:0.9;
filter:alpha(opacity=90); /* For IE8 and earlier */    
    color:white;
    font-weight:bold;
    padding: 30px 30px 30px 50px;
    text-align:center;
    position:absolute;
    right:0;
    bottom:0;
    z-index:1003;
    font-size: 20px;    
    border-top-left-radius: 125px;
    -moz-border-radius-topright: 125px;
}
​

您可以在 http://jsfiddle.net/ymorin007/7qX4U/ 看到我尝试过的内容

谢谢。

最佳答案

可能不是跨浏览器兼容的,但这会让你接近:)

.shape{
    background-color: black;
    opacity:0.9;
    filter:alpha(opacity=90); /* For IE8 and earlier */    
    color:white;
    font-weight:bold;
    padding: 30px 30px 30px 50px;
    text-align:center;
    position:absolute;
    right:0;
    bottom:0;
    z-index:1003;
    font-size: 20px;    
    border-top-left-radius: 125px;
    -moz-border-radius-topright: 125px;
}

.shape::before{
   content:"";
   width:0;
   height:0;
   position:absolute;
   left:-34px;
   border-left: 53px solid transparent;
   border-right: 53px solid transparent;    
   border-bottom: 53px solid black;
}
​

fiddle :http://jsfiddle.net/pggRb/

关于css - 使用 CSS 重现图像形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13648131/

相关文章:

javascript - 同时触发两个元素的悬停?

css - 如何将菜单栏放在横幅下方

javascript - 如何告诉样式标签从类中获取属性?

具有两个不同颜色或至少看起来像的边框的 CSS 圆圈

html - 柠檬形状(CSS 和 HTML)

javascript - 如何从 js 中禁用特定的 css 元素?

html - 元素根据 parent 和 sibling 调整宽度

css - 如何用CSS3制作图片阴影

CSS 从汉堡包图标转换为十字箭头

css - 凹形边界半径是否可能?