zoukankan      html  css  js  c++  java
  • css3

    css3 - 制作奇奇怪怪的背景


    内凹圆角的背景:

    效果图:

    代码如下:

    .background { display: inline-block; background: #dabe8d; position: relative; //为了伪类好定位。 400px; height: 400px; z-index: -1; //使其置于底部 } .background:before { //白色内凹圆角背景 content: ' '; 380px; height: 380px; background: #fff; background: radial-gradient(circle at top left, transparent 15pt,#fff 0) top left, /*左上角内凹圆角*/ radial-gradient(circle at top right, transparent 15pt,#fff 0) top right, /*右上角内凹圆角*/ radial-gradient(circle at bottom right, transparent 15pt,#fff 0) bottom right, /*右下角内凹圆角*/ radial-gradient(circle at bottom left, transparent 15pt,#fff 0) bottom left;/*左下角内凹圆角*/ background-size: 50% 50%; /*上方的radial-gradient 都只占1/4*/ background-repeat: no-repeat; display: inline-block; position: absolute; /*绝对定位至居中。*/ top: 10px; left: 10px; z-index: -1; /*使其置于底部*/ } .background:after { content: ' '; /*与背景同色内凹圆角背景,与:before重合形成边框。*/ 378px; height: 378px; background: #dabe8d; background: radial-gradient(circle at top left, transparent 15pt,#dabe8d 0) top left, /*左上角内凹圆角*/ radial-gradient(circle at top right, transparent 15pt,#dabe8d 0) top right, /*右上角内凹圆角*/ radial-gradient(circle at bottom right, transparent 15pt,#dabe8d 0) bottom right, /*右下角内凹圆角*/ radial-gradient(circle at bottom left, transparent 15pt,#dabe8d 0) bottom left; /*左下角内凹圆角*/ background-size: 50% 50%; /*上方的radial-gradient 都只占1/4*/ background-repeat: no-repeat; display: inline-block; position: absolute; /*绝对定位至居中*/ top: 11px; left: 11px; z-index: -1; /*使其置于底部*/ }
  • 相关阅读:
    启动窗体的程序控制与动画效果
    在线程中使用定时器
    从oracle9i/92数据库中导出数据至 oracle 8.1.7 数据库中
    收集:PowerDesigner常见问题解决与设置集锦
    [转]C# 2.0新特性与C# 3.5新特性
    COM服务器的创建过程
    [原创] 为什么需要TLS(Thread Local Storage)?
    COM+服务器的.Net组件实现 客户端
    如何在客户端避免繁冗的服务器GUID定义及导入?
    进程、线程、套间和环境
  • 原文地址:https://www.cnblogs.com/BlackBirch/p/7729574.html
Copyright © 2011-2022 走看看