CSS3 形状比例

标签 css shapes

当在 CSS3 中创建如下所示的形状时,请记住我希望尽可能保留大部分样式的最佳方法是什么?

enter image description here

最佳答案

如何使用具有 border-radius 属性的 CSS3 渐变?我是从头开始做的,你可以看看

Demo

   div {
        height: 200px;
        width: 200px;
        margin: 50px;
        border: 3px solid #B6801F;
        border-radius: 24px;
        background: #f7d060;
        background: -moz-linear-gradient(top,  #f7d060 0%, #ed8328 100%);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7d060), color-stop(100%,#ed8328));
        background: -webkit-linear-gradient(top,  #f7d060 0%,#ed8328 100%);
        background: -o-linear-gradient(top,  #f7d060 0%,#ed8328 100%);
        background: -ms-linear-gradient(top,  #f7d060 0%,#ed8328 100%);
        background: linear-gradient(to bottom,  #f7d060 0%,#ed8328 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7d060', endColorstr='#ed8328',GradientType=0 );
        box-shadow: 1px 2px 3px #313131;
        position: relative;
    }

    div span {
        position: absolute;
        top: 10px;
        width: 180px;
        left: 10px;
        height: 80px;
        background: -moz-linear-gradient(top,  rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.2) 100%);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(100%,rgba(255,255,255,0.2)));
        background: -webkit-linear-gradient(top,  rgba(255,255,255,0.7) 0%,rgba(255,255,255,0.2) 100%);
        background: -o-linear-gradient(top,  rgba(255,255,255,0.7) 0%,rgba(255,255,255,0.2) 100%);
        background: -ms-linear-gradient(top,  rgba(255,255,255,0.7) 0%,rgba(255,255,255,0.2) 100%);
        background: linear-gradient(to bottom,  rgba(255,255,255,0.7) 0%,rgba(255,255,255,0.2) 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3ffffff', endColorstr='#33ffffff',GradientType=0 );
        display: block;
        border-radius: 18px;
}

关于CSS3 形状比例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16351983/

相关文章:

css - ng-bootstrap 更改单选按钮的默认颜色

css - 在底部显示页脚

Java PaintComponent 作为 JComponent

html - 如何将八边形和p标签对齐在col的中心

html - 使用 HTML anchor 标记后内容隐藏在标题后面

html - 如何制作 KineticJs 自定义形状

ms-word - VBA Word 将文本框文本/段落垂直对齐设置为 "center"

colors - JavaFX-如何为形状填充颜色?

html - CSS网格体育场形状

javascript - 是否可以获取多个 <span> 元素的宽度?