设为首页 加入收藏

TOP

Task4
2019-09-03 01:58:14 】 浏览:20
Tags:Task4

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位和居中问题|百度前端学院</title>
    <link rel="stylesheet" href="css/task4.css">
</head>
<body>
    <div class="content">
        <div class="content-top">
        </div>
        <div class="content-bottom">
        </div>
    </div>
</body>
</html>
.content{
    width: 400px;
    height: 200px;
    background-color: #ccc;
    margin: 200px auto;
    position: relative;
}

.content-top{
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: #fc0;
    border-radius: 0 0 100% 0;
    top: 0;
    left: 0;
}

.content-bottom{
    position: absolute;
    background-color: #ffcc00;
    width: 50px;
    height: 50px;
    border-radius: 100% 0 0 0;
    bottom: 0;
    right: 0;
}

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇div元素宽度不定的情况下如何居中.. 下一篇盒模型——标准盒模型与怪异盒模型

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目