css3实现小米的logo

昨天小米笔试遇到的题目,实现如下

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>css3实现小米logo </title>
	<style type="text/css">
	body{
		background-color: #ccc;	
	}
	#main{
		background-color: #f57923;
		width: 415px;
		height: 300px;
		margin:150px auto;
		border-radius: 25px;
	}
	#left,#right{
		background-color: #fff;
		margin-top:40px;
		height: 220px;
	}
	#left{
		float: left;
		width: 250px;
		margin-left: 35px;
		border-top-right-radius: 65px;
		z-index: -99999;

	}
	#inner{
		background-color: #f57923;
		width: 140px;
		height: 170px;
		margin-left: 55px;
		margin-top: 50px;
		border-top-right-radius: 40px;
		z-index: 10px;

	}
	#center{
		background-color: #fff;
		position: relative;
		width: 50px;
		height: 125px;
		top:45px;
		left: 45px;
		z-index:999999; }
	#right{
	float: right;
	width: 50px;
	margin-right:35px;}

	</style>
</head>
<body>
	<div id="main">
		<div id="left">
			<div id="inner">
				<div id="center"></div>
			</div>
		</div>
		<div id="right"></div>
	</div>

	
</body>
</html>

效果如下:



评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值