html5+css 代码.docx_第1页
html5+css 代码.docx_第2页
html5+css 代码.docx_第3页
html5+css 代码.docx_第4页
html5+css 代码.docx_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1.css引用方式:内联式 div color:red; 行内式外联式import方式 import url(css/css1.css);2.相对路径: ./返回上一级目录 绝对路径:3. 表格:colspan 列合并 rowspan 行合并 cellspacing 单元格间距 a1 b1固定表格布局table table-layout:fixed;如何让表格边框为1px方法1:用边框的上下左右调整方法2:border-collapse:collapse 表格边框合并为单一边框 默认:separate table border-collapse:collapse; 列间隔 行间隔:border-spacing border-spacing:10px 5px;文字水平对齐 text-align - left center righttable text-align:center; 空单元格 empty-cells:hide隐藏空单元格 show显示空单元格table empty-cells:hide; 表格居中table margin: auto; 垂直对齐 vertical-align - top middle bottomtable tr td vertical-align:top; 4.圆角问题:border-bottom-left-radius: ;border-bottom-right-radius: ;border-top-left-radius: ;border-top-right-radius: ;border-radius: 10px 0px 0px 10px;5. 伪类:hover-鼠标悬停table tr:hover background-color: blue; -行悬停table tr td:hover background-color: blue; -每个表格悬停table tr th:hover background-color:red; -表头悬停6.表头 t1 t2 t37. 表格当中添加表格 8. 透明度:.uname:hover background-color: red; opacity: 0.2;9.焦点:.pwd:focus background-color: green; width: 300px;10.表单及表单控件: action:提交地址 action=提交当前页 method:提交方式 get-默认 post-更加安全(1)(2)(3) 1)登录 2)(4) -ajax 局部刷新(5)(6) -value=不同 name=相同男女(7) -value=不同 name=相同爱好:学习 游戏 睡觉(8)城市: 北京 上海 哈尔滨 (9)简介:(10)上传文件:(11)(12) !-不好使- 11. 外边距margin-left margin-right margin-top margin-bottom 1)元素(盒子)垂直排列,margin上下合并,取最大值。 2)元素(盒子)水平排列,margin左右累加 margin允许有负值margin:20px; 四边margin:20px 40px; 上下 左右margin:20px 180px 200px; 上 左右 下margin:20px 700px 80px 100px; 上 右 下 左12. 内边距 padding-left padding-right padding-top padding-bottompadding 不允许负值padding:50px; 四边padding:30px 40px; 上下 左右padding:20px 20px 40px; 上 左右 下padding:20px 40px 20px 40px; 上 右 下 左13. 加粗:font-weight: border 100900;简写:font:italic bolder 20px arial ;(简写:20px arial 必写 顺序不能颠倒)14.背景简写:background: red url() no-repeat fixed top;简写 顺序可变15.字体单位:px 像素cm 厘米pt 磅in 英寸百分比 对默认字体缩放(不同浏览器默认字体不同,默认最小字体也不同)em 字号倍数,相对于默认字体(父元素或浏览器)/font-size:2em;/pt cm in 200%原基础上放大 50%原基础上缩小 em成倍数放大/16.使红框固定大小labelwidth: 100px; border:1px solid red; display: inline-block;email:user name:17.表示label标签要绑定的HTML元素,你点击这个标签的时候,所绑定的元素将获取焦点email:18. 颜色的表示方式 1)颜色名 如red color:red; 2)rgb() 范围0-255 red green blue 黑:rgb(0,0,0) 白:rgb(255,255,255) color:rgb(255,0,0) 3)十六进制表示,如#fea230color:#ff0000; 4)十六进制简写:#223344简写为 #234 color:#234;19. 背景图片定位background-position:top right;简写:background:url(images/1.jpg) no-repeat top right;20.CSS3 阴影box-shadow:(inset内阴影,省略为外阴影)水平偏移量,垂直偏移量,阴影模糊度,阴影大小,阴影颜色box-shadow: 10px 10px 10px 10px black; (外阴影)box-shadow:inset 10px 10px 10px 10px black; (内阴影)21. 伪类:被选中(被激活).d01:active background: blue;22.先隐藏,鼠标悬浮时显示(隐藏的模块必须被包含在悬停的模块里).d02 /*隐藏*/ display: none;.d01:hover .d02 /*显示*/ display: block; 23. line-height:10px; /行高 /与height所设值相同时,文字垂直居中24.块级元素:与同级元素竖直排列,且左右撑满 如:div ul li p dd dt dl行级元素:与同级元素横向排列,且内容自适应,不会左右撑满 如:span a img input span a:宽高不能改变 img input:宽高能改变(特例)标准流static:css规定的默认的块级元素与行级元素的排列方式display: block; 将当前元素转换为块级元素display: inline; 将当前元素转换为行级元素display: inline-block; 行级块元素25.display 与 visibility区别?display 不占用空间(后元素补位) visibility 占用空间(保留原元素空间) display: none; /隐藏 display: block; /显示 visibility: hidden; /隐藏 visibility: visible; /显示26.浮动 float:left; float:right; 1)浮动的元素会脱离标准流 2)如前面有浮动元素,会依次排在后面 3)浮动是以标准流所在位置为起始点 4)同高度元素横向排满后,会被“挤”到下面 5)不同高度元素横向排满后,挤下后会被其他元素“卡”住 6)清除浮动:clear:both/left/right; 7)一个div的范围是由它里面的标准流决定的,与里面浮动的内容无关27.绝对定位 1)position: absolute; left right top bottom 2)对定位脱离标准流 3)绝对定位的元素是以它最近的一个已经定位的祖先元素为基准进行偏移 如果没有已经定位的祖先元素,则会以浏览器窗口为基准进行偏移 4)多个元素绝对定位,后面定位的元素的层级会高于前面(覆盖之前的元素) 5)z-index 设定层级28.相对定位 1)position: relative; left right top bottom 2)相对定位不脱离标准流 3)相对定位元素会相对于它原来的位置进行偏移,不受父元素影响 /相对定位、绝对定位允许负值 /相对定位、绝对定位对浮动元素依然有效29. position:static; 恢复标准流30. .tab1_content display: none;.tab1:hover .tab1_content display: block; tab1 1111111111131.列表类型list-style-type: circle;空心list-style-type: disc;实心list-style-type: square;实心正方形list-style-type: decimal;数字list-style-type: decimal-leading-zero;零开头的数字标记list-style-type: lower-roman;小写罗马list-style-type: upper-roman;大写罗马列表缩进list-style-position: inside;列表图片list-style-image: url(images/1.jpg);简写 顺序不能改变list-style:circle inside url(images/1.jpg);取消样式list-style: none; a111111111 a222222222 a333333333 b111111111 b222222222 b333333333 计算机图书 css计算 java应用 幼儿图书 365故事 唐诗30032.固定定位 1)position: fixed; left right top bottom 2)固定定位脱离标准流(只有相对定位不脱离标准流) 3)固定定位元素是以浏览器窗口或其他显示设备窗口为基准进行偏移 4)固定定位对浮动元素依然有效33.盒子模型34. 盒子模型一.标准模式(严格模式strictmode):浏览器按w3c标准解析执行代码怪异模式(兼容模式quirkmode):使用浏览器自己的方式解析执行代码 由于不同浏览器解析执行的方式不同 所以称之为怪异模式二.如何检测当前执行模式alert(patMode);输出:css1compat 标准模式 backcompat 怪异模式 (ie盒子模型:实际宽度=width+margin)?三.标准模式与怪异模式的区别标准模式:实际宽度=width+border+padding+margin怪异模式:实际宽度=width+border+margin 注意:ie6ie7ie8在怪异模式下会以此方式显示 其他高级浏览器在怪异模式下依然以标准模式显示 实际宽度=width+border+margin4. 如何区别? 1.html5:有表示为 标准模式 2.html4: (1) (2) (3)五.border:占用空间outline:不占用空间CSS框模型(Box Model)规定了元素框处理元素 内容、内边框、边框、外边框 的方式六.html结构css表现35.html框架 定义name 使超链接在定义mane的另一个模块中打开36.内联框架图片1网页2两个超链接点击后在名为if1name的内联框架中显示37. 1)浮动法 .header,.footer,.container margin:0 auto; .header,.footer width: 400px; height: 50px; border: 1px solid #ff0000; float: left; .container width: 400px; height: 250px; .content width: 298px; height: 248px; border: 1px solid #ff0000; float: left; .side width: 98px; height: 248px; border: 1px solid #ff0000; float: right; 2)定位法 .header,.footer,.container margin:0 auto; .header,.footer,.container width: 400px; height: 50px; border: 1px solid #ff0000; position: relative; top:50px; .container width: 400px; height: 250px; position: relative; top:50px; .content width: 298px; height: 248px; border: 1px solid #ff0000; position: absolute; top:0px; left:0px; .side width: 100px; height: 248px; border: 1px solid #ff0000; position: absolute; top:0px; left:300px; 3)display法(table法) .header,.footer,.container margin:0 auto; .header,.footer width: 400px; height: 50px; border: 1px solid #ff0000; .container width: 400px; height: 250px; border: 1px solid #ff0000; display: table; .content border: 1px solid #ff0000; display: table-cell; .side border: 1px solid #ff0000; display: table-cell; 38. 变宽变高布局/*比例法 宽度百分比*/.header,.footer width: 80%; height: 100px; border: 1px solid #000000; margin: 0 auto;/*高度自适应布局*/.content width: 80%; margin: 0 auto; border: 1px solid #000000; float: le

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论