css实现三角形原理
来源:互联网 发布:数据库事务特性 老婆 编辑:程序博客网 时间:2024/06/07 04:06
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*div{display:inline-block;}*/
.rectangle{width:200px;height:100px;background-color:cornflowerblue;border:20px solid #C4E3F3;}
.rectangle-without-width{height:100px;width:0;background-color:cornflowerblue;border:20px solid #C4E3F3;}
.rectangle-without-width-length{width:0;height:0;background-color:cornflowerblue;border:20px solid #C4E3F3;}
.leftTop{
width:0;
height:0;
border-left:20px solid #C4E3F3;
border-top:20px solid #C4E3F3;
border-right:20px solid #C4E3F3;
}
.triangle1{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:#C4E3F3 transparent transparent transparent;
}
.triangle2{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:transparent #C4E3F3 transparent transparent;
}
.triangle3{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:transparent transparent #C4E3F3 transparent;
}
.triangle4{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:transparent transparent transparent #C4E3F3;
}
.triangle5{
width:0;
height:0;
border-width:20px;
border-left-width:10px;
border-style:solid;
border-color:transparent transparent transparent #C4E3F3;
}
.triangle6{
width:0;
height:0;
border-left:20px solid #C4E3F3;
border-top:20px solid transparent;
}
</style>
</head>
<body>
<h1>前提是将div设置为display:inline-block</h1>
<h2>长方形1</h2>
<div class="rectangle">
</div>
<h2>长方形宽度为0</h2>
<div class="rectangle-without-width">
</div>
<h2>长方形宽度高度为0</h2>
<div class="rectangle-without-width-length">
</div>
<h2>左下右</h2>
<div class="leftTop">
</div>
<h2>三角形1</h2>
<div class="triangle1">
</div>
<h2>三角形2</h2>
<div class="triangle2">
</div>
<h2>三角形3</h2>
<div class="triangle3">
</div>
<h2>三角形4</h2>
<div class="triangle4">
</div>
<h2>三角形5</h2>
<div class="triangle5">
</div>
<h2>直角三角形</h2>
<div class="triangle6">
</div>
</body>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*div{display:inline-block;}*/
.rectangle{width:200px;height:100px;background-color:cornflowerblue;border:20px solid #C4E3F3;}
.rectangle-without-width{height:100px;width:0;background-color:cornflowerblue;border:20px solid #C4E3F3;}
.rectangle-without-width-length{width:0;height:0;background-color:cornflowerblue;border:20px solid #C4E3F3;}
.leftTop{
width:0;
height:0;
border-left:20px solid #C4E3F3;
border-top:20px solid #C4E3F3;
border-right:20px solid #C4E3F3;
}
.triangle1{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:#C4E3F3 transparent transparent transparent;
}
.triangle2{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:transparent #C4E3F3 transparent transparent;
}
.triangle3{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:transparent transparent #C4E3F3 transparent;
}
.triangle4{
width:0;
height:0;
border-width:20px;
border-style:solid;
border-color:transparent transparent transparent #C4E3F3;
}
.triangle5{
width:0;
height:0;
border-width:20px;
border-left-width:10px;
border-style:solid;
border-color:transparent transparent transparent #C4E3F3;
}
.triangle6{
width:0;
height:0;
border-left:20px solid #C4E3F3;
border-top:20px solid transparent;
}
</style>
</head>
<body>
<h1>前提是将div设置为display:inline-block</h1>
<h2>长方形1</h2>
<div class="rectangle">
</div>
<h2>长方形宽度为0</h2>
<div class="rectangle-without-width">
</div>
<h2>长方形宽度高度为0</h2>
<div class="rectangle-without-width-length">
</div>
<h2>左下右</h2>
<div class="leftTop">
</div>
<h2>三角形1</h2>
<div class="triangle1">
</div>
<h2>三角形2</h2>
<div class="triangle2">
</div>
<h2>三角形3</h2>
<div class="triangle3">
</div>
<h2>三角形4</h2>
<div class="triangle4">
</div>
<h2>三角形5</h2>
<div class="triangle5">
</div>
<h2>直角三角形</h2>
<div class="triangle6">
</div>
</body>
</html>
0 0
- css实现三角形原理
- css实现三角形原理
- css三角形的实现原理
- 经典CSS实现三角形图标原理解析
- CSS实现三角形图标的原理
- 经典CSS实现三角形图标原理解析
- css实现三角形,五角星,爱心等原理
- css三角形滴原理
- css三角形滴原理
- CSS-三角形及其原理..........
- CSS绘制三角形原理
- 终于搞懂了CSS实现三角形图标的原理
- 终于搞懂了CSS实现三角形图标的原理
- 搞懂了CSS实现三角形图标的原理
- css实现三角形
- CSS border实现三角形
- CSS border实现三角形
- css实现画三角形
- 莫比乌斯反演—详解
- hdoj1495简单BFS
- STL标准入门汇总
- Spring之AOP(学习笔记)
- Android RadioButton与ListView的混合使用
- css实现三角形原理
- haproxy
- I/O多路复用之select/poll/epoll
- bash 命令执行环境
- 树状数组及其应用(2)
- jQuery工具方法
- POST请求给后台传JSON
- android SwipeRefreshLayout使用遇到问题分(二)--滑动冲突
- WWN,WWNN,WWPN区别