html学习笔记4-border画圣诞树
2015-07-03 18:05
666 查看
先上图:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>用css控制border画三角形</title>
<style>
div{
width:200px;
height:200px;
background-color:auto;
}
.triangle{
width:0px;
height:0px;/*这里的数控制border中心方块的大小*/
border-top:0px solid;
border-left:100px solid;
border-bottom:100px solid;
border-right:100px solid;
border-color:transparent transparent #090 transparent;
/*transparent设置边框颜色为透明*/
}
.triangle1{
width:0px;
height:0px;/*这里的数控制border中心方块的大小*/
border-top:0px solid;
border-left:100px solid;
border-bottom:100px solid;
border-right:100px solid;
border-color:transparent transparent #090 transparent;
/*transparent设置边框颜色为透明*/
margin-top:-20px;/*距离顶部的距离*/
}
#sg{
width:50px;
height:60px;
background-color:#630;
margin:0px 80px;
}
</style>
</head>
<body>
<div>
<div class="triangle"></div>
<div class="triangle1"></div>
<div class="triangle1"></div>
<div id="sg"></div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>用css控制border画三角形</title>
<style>
div{
width:200px;
height:200px;
background-color:auto;
}
.triangle{
width:0px;
height:0px;/*这里的数控制border中心方块的大小*/
border-top:0px solid;
border-left:100px solid;
border-bottom:100px solid;
border-right:100px solid;
border-color:transparent transparent #090 transparent;
/*transparent设置边框颜色为透明*/
}
.triangle1{
width:0px;
height:0px;/*这里的数控制border中心方块的大小*/
border-top:0px solid;
border-left:100px solid;
border-bottom:100px solid;
border-right:100px solid;
border-color:transparent transparent #090 transparent;
/*transparent设置边框颜色为透明*/
margin-top:-20px;/*距离顶部的距离*/
}
#sg{
width:50px;
height:60px;
background-color:#630;
margin:0px 80px;
}
</style>
</head>
<body>
<div>
<div class="triangle"></div>
<div class="triangle1"></div>
<div class="triangle1"></div>
<div id="sg"></div>
</div>
</body>
</html>
相关文章推荐
- < meta > 元素
- 使用HTML打开本地应用
- 在html中如何获取表单提交的数据
- Html 全屏切换效果
- C#去除HTML标记,包括HTML的源码
- 那些你不熟悉的html元素属性
- HTML 表单(form) 使用详解
- 学习html(5)
- Char Tools,方便的字符编码转换小工具
- html中插入.flv
- 学习html(4)
- @RenderBody、@RenderSection、@RenderPage、Html.RenderPartial、Html.RenderAction的作用和区别
- HTML基本介绍
- 为什么使用<!DOCTYPE HTML>
- HTML中的<select>标签如何设置默认选中的选项
- html span标签 不换行(有时span带中文时候是可以自动换行的)
- Creating HTML table with vertically oriented text as table header 表头文字方向
- location,window,html的使用
- Html.ActionLink render “?Length=数值”
- html页面高度自适应