用css绘制基本图形
2018-01-05 11:46
435 查看
先上个效果看一下
代码如下
<!DOCTYPE html>
<html>
<head>
<title>用css制作图形</title>
<meta charset="utf-8">
<style type="text/css">
.square{
width:50px;
height:50px;
background:red;
float:left;
}
.rectangle{
width:50px;
height:20px;
float:left;
background:yellow;
}
.triangle{
width:0px;
height:0px;
float:left;
border:30px solid;
border-color:transparent transparent red transparent;
}
.circle
{
width:100px;
height:100px;
float:left;
background:yellow;
border-radius: 50px
}
.Trapezoid{
width:40px;
border:30px;
float:left;
border:30px solid;
border-color:red transparent transparent transparent;
}
.halfcircle
{
position:relative;
top:175px;
left:40px;
transform:rotate(270deg);
width:120px;
height:60px;
background:blue;
border-radius: 60px 60px 0px 0px
}
</style>
</head>
<body>
<div class="square">
</div>
<div class="rectangle">
</div>
<div class="triangle">
</div>
<div class="circle">
</div>
<div class="Trapezoid">
</div>
<div class="halfcircle">
</div>
</body>
</html>
代码如下
<!DOCTYPE html>
<html>
<head>
<title>用css制作图形</title>
<meta charset="utf-8">
<style type="text/css">
.square{
width:50px;
height:50px;
background:red;
float:left;
}
.rectangle{
width:50px;
height:20px;
float:left;
background:yellow;
}
.triangle{
width:0px;
height:0px;
float:left;
border:30px solid;
border-color:transparent transparent red transparent;
}
.circle
{
width:100px;
height:100px;
float:left;
background:yellow;
border-radius: 50px
}
.Trapezoid{
width:40px;
border:30px;
float:left;
border:30px solid;
border-color:red transparent transparent transparent;
}
.halfcircle
{
position:relative;
top:175px;
left:40px;
transform:rotate(270deg);
width:120px;
height:60px;
background:blue;
border-radius: 60px 60px 0px 0px
}
</style>
</head>
<body>
<div class="square">
</div>
<div class="rectangle">
</div>
<div class="triangle">
</div>
<div class="circle">
</div>
<div class="Trapezoid">
</div>
<div class="halfcircle">
</div>
</body>
</html>
相关文章推荐
- 纯CSS绘制基本图形
- 纯CSS画的基本图形技巧绘制(矩形、圆形、三角形、多边形、爱心、八卦等)
- CSS 魔法系列:纯 CSS 绘制基本图形(圆、椭圆等)
- 『原创』DX图形显示基本流程(基于MESH静态模型绘制----托管代码)
- [置顶] HTML5 绘制图形 Canvas 与 SVG 的基本用法
- 纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)
- 纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)
- 关于CSS绘制图形的转载
- CSS绘制常见形状的图形
- 纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)
- processing绘制图形的基本属性
- CSS 魔法系列:纯 CSS 绘制各种图形《系列六》
- OpenGL绘图的基本过程是:清除缓冲区,设置当前颜色,绘制几何图元,输出图形。
- CSS基本图形总结
- Open CV 学习笔记:基本图形绘制
- css基础图形绘制
- iOS-UIBezierPath绘制基本图形
- Graphics类提供基本的几何图形绘制方法,主要有:画线段、画矩形、画圆、画带颜色的图形、画椭圆、画圆弧、画多边形等。
- 【emWin】例程七:绘制基本图形
- 11-UIKit(Storyboard、View的基本概念、绘制图形、UIBezierPath)