学习笔记:纯css画图

<!DOCTYPE html>
<html>
<head>
	<meta cahrset="utf-8">
<style>

.box1
{
	width: 0px;
	height: 0px;
	border: 20px solid black;
}

.box2
{
	width: 0px;
	height: 0px;
	border-bottom: 20px solid red;
	border-left: 20px solid transparent;	
}

.box3
{
	width: 100px;
	height: 0px;
	border-bottom: 100px solid red;
	border-left: 50px solid transparent;
	border-right: 50px solid transparent;
}

.box4
{
	 width: 150px; 
	 height: 100px; 
	 -webkit-transform: skew(-20deg);  /* 倾斜-20度*/
	 background: #669;
	 margin-left:20px;
}

.box5
{
	width: 100px;
	height: 100px;
	background-color: red;
	border-radius: 50px;      /* 设置圆角*/
}

.box6
{
	width: 100px;
	height: 100px;
	border:20px solid black;
	background:white;
	-webkit-border-radius: 100px;
}

.box7
{
	width: 100px;
	height: 0px;
	border:0px solid black;
	border-top: 100px solid red;
	border-right: 100px solid red;
	-webkit-border-radius:100px 100px 0 0;
}

.box8
{
	width: 100px;
	height: 0px;
	border:0px solid red;
	border-top: 100px solid red;
	-webkit-border-radius:100px 0 0 0;
}

.box9
{
	width: 200px;
	height: 100px;
	background: red;
	-webkit-border-radius:50%;
}

.box10
{
	border-bottom: 30px solid red;
	width: 100px;
	height: 100px;
	-webkit-border-radius:0 0 0 100px;
}

.box11
{
	width: 200px;
	height: 100px;
	background-color: red;
	-webkit-border-radius:20px;
	position: relative;
}
.box11:after               /*:after在元素后面添加内容*/
{
	content: "";
	border-bottom: 30px solid red;
	width: 50px;
	height: 50px;
	-webkit-border-radius:0 0 0 200px;
	position: relative;
	-webkit-transform:rotate(-90deg);        /*旋转-90度*/
	position: absolute;
	top: 60px;
}

.box12
{
	width: 250px;
	height: 100px;
	background-color: red;
	-webkit-border-radius:50px 0 0 50px;
	-webkit-transform:rotate(45deg);
	position: relative;
}

.box13
{
	width:160px;
	height: 200px;
	position: relative;
}
.box13:before
{
	content:" ";
	width: 80px;
	height: 120px;
	background-color: red;
	-webkit-border-radius:100px 100px 0 0;
	-webkit-transform:rotate(-45deg);
	position: absolute;
	left: 20px;
}
.box13:after
{
	content: " ";
	width: 80px;
	height: 120px;
	background-color: red;
	-webkit-border-radius:100px 100px 0 0;
	-webkit-transform:rotate(45deg);
	position: absolute;
	left: 50px;
}
</style>
</head>
	<h1>1</h1>
	<div class="box1"></div>    <!-- //正方形 -->
	<br>
	<h1>2</h1>
	<div class="box2"></div>	<!-- //直角三角形 -->
	<br>
	<h1>3</h1>
	<div class="box3"></div>	<!-- //等腰梯形 -->
	<br>
	<h1>4</h1>
	<div class="box4"></div>	<!-- //平行四边形 -->
	<br>
	<h1>5</h1>
	<div class="box5"></div>	<!-- //圆 -->
	<br>
	<h1>6</h1>
	<div class="box6"></div>	<!-- //同心圆 -->
	<br>
	<h1>7</h1>
	<div class="box7"></div>	<!-- //上半圆 -->
	<br>
	<h1>8</h1>
	<div class="box8"></div>	<!-- //下半圆 -->	
	<br>
	<h1>9</h1>
	<div class="box9"></div>	<!-- //椭圆 -->	
	<br>
	<h1>10</h1>
	<div class="box10"></div>	<!-- //小尾巴 -->	
	<br>
	<h1>11</h1>
	<div class="box11"></div>	<!-- //提示框 -->
	<br><br><br><br><br><br><br><br>
	<h1>12</h1>
	<div class="box12"></div>	<!-- //倾斜的胶囊 -->
	<br><br><br><br><br><br><br><br>
	<h1>13</h1>
	<div class="box13"></div>	<!-- //爱心 -->
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值