table布局 div布局优势
  浏览器支持完善
  表现和结构分离
  样式设计控制功能强大
  可以继承,层叠处理
Transitional // 松散过度型
Strict //严格型
Frameset //比较不常用的,使用框架使用这种模式
XHTML中的所有标签都是要闭合的比如 "<input/>"
但是在HTML中就不必这样

"<input>"即可 
CSS中的数据单位:

px : 像素
em : 当前对象体内的字体尺寸(好像英文比较常用这个尺寸)
ex : 当前字符高度的相对尺寸 ( font-size:1.2ex,当前字符的1.2倍高)
pt : 点/镑point (font-size:9pt;)
pc : 派卡 pica
in : 英寸
pc : 派卡 pica
mm : 毫米
cm :厘米
rgb : (0,0,0)
rgba:(0,0,0,0.2)
rrggbb :十六进制的颜色单位 #ffffff;
colorName : 字体颜色(color:blue)
样式分有三种 :
  1. 行间样式
  2. 内部样式
  3. 外部样式

css布局和定位:

/固定宽度的布局/

/流式布局(按照%比)/

/弹性布局,根据字体 em进行布局/

1:一列自适应: width:80%;

    <h5>一列固定居中: margin:0 auto;</h5>
<h5>二列固定宽度:</h5>
<div id="two-row" class="clearFix">
<style>
.clearFix:after{
content:"";
display:block;
visibility:visible;
clear:both;
height:0;
}
#two-row {
width:500px;
background:#666
}
#two-row .left{
width:200px;
background:#0C9;
float:left;
}
#two-row .right{
width:300px;
background:#069;
float:left;
}
</style>
<div class="left">row1</div>
<div class="right">row2</div>
</div>

  

2:两列宽度自适应:利用左右定位;中间居中

    <div id="two-auto" class="clearFix">
<style>
.clearFix:after{
content:"";
display:block;
visibility:visible;
clear:both;
height:0;
}
#two-auto {
background:#666
}
#two-auto .left{
width:35%;
background:#0C9;
float:left;
}
#two-auto .right{
width:30%;
background:#069;
float:left;
}
</style>
<div class="left">auto-left</div>
<div class="right">auto-right</div>
</div>
3:两列右列宽度自适应
<div id="right-auto">
<style>
#right-auto{
}
#right-auto .left{
width:100px;
float:left;
background:#ccc;
}
#right-auto .right{
background:#f00;
border:2px solid #000;
}
</style>
<div class="left">left</div>
<div class="right">right</div>
</div>
    <h5>三列自适应</h5>
<div id="three">
<style>
#three{
position:relative;
}
#three .left{
position:absolute;
left:0;top:0;
width:100px;
height:300px;
background:#C99;
}
#three .right{
position:absolute;
top:0;right:0;
width:100px;
height:300px;
background:#C99;
}
#three .center{
margin-left:100px;
margin-right:100px;
height:300px;
background:#F03;
}
</style>
<div class="left">left</div>
<div class="right">right</div>
<div class="center">center</div>
</div>
    <h5>三列自适应;利用左右浮动;中间居中</h5>
<div id="three-1">
<style>
#three-1{
position:relative;
}
#three-1 .left{
float:left;
width:100px;
height:300px;
background:#C99;
}
#three-1 .right{
float:right;
width:100px;
height:300px;
background:#C99;
}
#three-1 .center{
margin-left:100px;
margin-right:100px;
height:300px;
background:#F03;
}
</style>
<div class="left">left</div>
<div class="right">right</div>
<div class="center">center</div>
</div>

高度自适应:

高度自适应这个必须设置 html,body{height:100%} 因为ff和ie中html,和body的高度是不同的,这么写是处理兼容问题; ff,chrome{html为当前视区大小,要把html100%的高度,body为内部内容高度,滚动出现在html中} ie{html为隐藏的好像;body为内部内容的高度,滚动是出现在body中的}
 
盒模型; 主要是IE和IE6的怪异模式'
box-sizing:border-box; box-sizing:content-box; box-sizing:padding-box;
margin叠加和margin双倍解决
for example:
background
background-image; background-color: background-repeat; background-attachment:设置背景图的滚动方式,背景会被固定住,不会随着scroll改变; background-position: 左对齐方式 ,右对齐方式;
超出div的内容区域
//要换行最好都加,这样可以处理英文和中文 word-break:break-all;允许词间换行; word-wrap:break-word超过容器就换行 white-space:no-wrap;超过容器不换行;
img标签的clip剪切css
这个东西不常用; img{ position:absolute; clip:rect(1px 2px 3px 4px) }

CSS基础和布局复习的更多相关文章

  1. 一、HTML和CSS基础--网页布局--网页简单布局之结构与表现原则

    结构.表现和行为分离,不仅是一项技术,更主要的是一种思想,当我们拿到一个网页时,先考虑设计图中的文字内容和内容模块之间的关系,重点放在编写html结构和语义化,然后考虑布局和表现形式.,减少HTML与 ...

  2. 一、HTML和CSS基础--网页布局--网页布局基础

    W3C标准: 由万维网联盟制定的一系列标准,包括: 结构化标准语言(HTML和XML) 表现标准语言(CSS) 行为标准语言(DOM和ECMAScript) 倡导结构.样式.行为分离. CSS 规定的 ...

  3. [19/06/07-星期五] CSS基础_布局&定位&背景样式

    一.固定布局(不适应设备的浏览器的变化) <!DOCTYPE html> <html> <head> <meta charset="UTF-8&qu ...

  4. 一、HTML和CSS基础--网页布局--实践--导航条菜单的制作

    案例一:导航菜单的制作 垂直菜单

  5. 一、HTML和CSS基础--网页布局--如何用css进行网页布局

    什么叫做布局? 又称版式布局,是网页UI设计师将有限的视觉元素进行有机的排列组合. 网页设计的特点 网页可以自适应宽度 网页的高度理论上可以无限延长 网页分栏 分栏又称为分列,常见的布局分为:一列布局 ...

  6. 一、HTML和CSS基础--网页布局--实践--固定层效果

    absolute和fixed的相同点: 第一,完全脱离标准文档流 第二,未设置偏移量时,都定位在父元素的左上角 absolute和fixed的不同点: 第一.当设置偏移量时,偏移参照基准不同 abso ...

  7. 前端开发:css基础知识之盒模型以及浮动布局。

    前端开发:css基础知识之盒模型以及浮动布局 前言 楼主的蛮多朋友最近都在学习html5,他们都会问到同一个问题 浮动是什么东西?  为什么这个浮动没有效果?  这个问题楼主已经回答了n遍.今天则是把 ...

  8. CSS基础选择器(选择器的优先级),CSS样式块( 长度/颜色/显示方式/文本样式),盒模型组成,盒模型-block,盒模型布局

    CSS基础选择器 (1)id选择器:   #       =>  标签拥有 id="user"  属性 <style> #user { width: 200px; ...

  9. css基础 引用方式 标签选择器 优先级 各式布局

    今天讲的css基础,了解了css即层叠式表,是美化网页,控制页面的样式. 样式表引进网页的3种方式1内联式,语法例子:<div style="width: 100px;height: ...

随机推荐

  1. /etc/default/useradd配置文件详解

    /etc/default/useradd文件内容如下: [xf@xuexi ~]$ cat /etc/default/useradd # useradd defaults file GROUP=100 ...

  2. (转) redis的事务和watch

    redis的事务 严格意义来讲,redis的事务和我们理解的传统数据库(如mysql)的事务是不一样的. redis中的事务定义 Redis中的事务(transaction)是一组命令的集合. 事务同 ...

  3. 【BZOJ 2916】 2916: [Poi1997]Monochromatic Triangles (容斥)

    2916: [Poi1997]Monochromatic Triangles Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 310  Solved: 1 ...

  4. 【BZOJ 2806】 2806: [Ctsc2012]Cheat (SAM+二分+DP+单调队列)

    2806: [Ctsc2012]Cheat Time Limit: 20 Sec  Memory Limit: 256 MBSubmit: 1262  Solved: 643 Description ...

  5. Linux sort 排序 去重 统计

    先写一个命令: cut -d' ' -f1 ~/.bash_history|sort -d | uniq -c|sort -nr|head 这个命令可以统计你历史上输入的命令的次数的前十条 整个命令基 ...

  6. 禁用substr、substring、mid函数的sql注入脚本

    #encodeing=utf-8 import requests import sys reload(sys) sys.setdefaultencoding('utf-8') payloads = l ...

  7. bzoj 2820

    收获: 当一个东西的取值有限时,我们可以枚举它,然后统计它被计算了多少次. #include <cstdio> #include <iostream> using namesp ...

  8. Codeforces Beta Round #10 D. LCIS 动态规划

    D. LCIS 题目连接: http://www.codeforces.com/contest/10/problem/D Description This problem differs from o ...

  9. VK Cup 2016 - Qualification Round 2 C. Road Improvement dfs

    C. Road Improvement 题目连接: http://www.codeforces.com/contest/638/problem/C Description In Berland the ...

  10. system.ComponentModel.Win32Exception (0x80004005): 目录名无效。 解决方法

    有时候我们需要在程序中调用 cmd.exe  执行一些命令 比如 我们会在程序写到 /// <summary> /// 执行Cmd命令 /// </summary> /// & ...