DIV基础 html颜色代码表

2016-04-10 14:43:00
admin
原创 2358
摘要:DIV基础 html颜色代码表

一、什么是DIV?

DIV是层叠样式表中的定位技术,全称DIVision,即为划分。有时可以称其为图层。
DIV元素是用来为HTML(标准通用标记语言下的一个应用)文档内大块(block-level)的内容提供结构和背景的元素。

DIV是一个块级元素,也就是说浏览器通常会在div元素前后放置一个换行符。


二、html颜色代码表

http://tool.webmasterhome.cn/html-color.asp


三、示例1,float=left

代码下载:float-left.html


<style type="text/css">
.main {
width: 300px;
height: 200px;
background: #09F;
}
.main-kid1 {
width: 100px;
height: 100px;
background: #F96;
float: left;
}
.main-kid2 {
width: 100px;
height: 100px;
background: #F9F;
float: left;
}
</style>
<div class="main">
<div class="main-kid1">1</div>
<div class="main-kid2">2</div>
</div>


效果图:


四、示例2:float=right

代码下载:float-right.html


<style type="text/css">
.main {
width: 300px;
height: 200px;
background: #09F;
}
.main-kid1 {
width: 100px;
height: 100px;
background: #F96;
float: left;
}
.main-kid2 {
width: 100px;
height: 100px;
background: #F9F;
float: right;
}
</style>
<div class="main">
<div class="main-kid1">1</div>
<div class="main-kid2">2</div>
</div>


效果图:

    发表评论
    评论通过审核之后才会显示。