CSS描述了网页的布局

1.CSS格式css

CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明;CSS声明老是以分号(;)结束,声明组以大括号({})括起来:浏览器

.style{color:red;text-align:center;}

2.CSS 注释:/**/spa

3.CSS 选择器
HTML元素以id属性来设置id选择器,CSS 中 id 选择器以 "#" 来定义code

#terminal
{
text-align:center;
color:red;
}

class 选择器在HTML中以class属性表示, 在 CSS 中,类选择器以一个点"."号显示blog

.center {text-align:center;}

指定特定的HTML元素使用classterminal

p {text-align:center;}


4.CSS 建立
插入样式表的方法有三种:内联样式)Inline style > (内部样式)Internal style sheet >(外部样式)External style sheet > 浏览器默认样式it

外部样式表(External style sheet)io

<head>
<link rel="stylesheet" href="../css/box.css">
</head>

内部样式表(Internal style sheet)class

<head>
<style>
.bigBox{overflow:hidden;left: 0px; right: 0px;width: 100%;}
.LeftBox { float: left;width: 63%; height:98%; margin-top:1%;margin-bottom:1%;margin-left:1%;margin-right:1%;}
.RightBox { float: left;width: 33%; height:98%; margin-top:1%;margin-bottom:1%;margin-left:1%;margin-right:1%;}
.box {
position: relative; 
background: #003; 
border-top: 1px solid #d2d6de;
border-top-color: #383838; 
}
</style>
</head>

内联样式(Inline style)float

<div id="full" class="bigBox" style="height:1000px;">
相关文章
相关标签/搜索