里面带有圆角顶部的背景 [英] Background with radius-top inside

查看:37
本文介绍了里面带有圆角顶部的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何应用背景(在CSS中),如您在所附图片中看到的那样?

Does anyone have an idea how to apply a background (in css) as you can see on the picture attached ?

感谢

推荐答案

div {
    background:lightgreen;
    width:100%;
    height:200px;
    position:relative;
    text-align:center;
    padding:100px 0 0 0;
    box-sizing:border-box;
}
div:before {
    content:'';
    position:absolute;
    background:white;
    width:100%;
    height:100px;
    top:0;
    left:0;
    border-radius:40%;
    transform:translatey(-50%);
}

<div>div</div>

这篇关于里面带有圆角顶部的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆