2019年9月23日
摘要: 1.伪元素定义 概念:在当前元素内容的前面或者后面追加一个虚拟的标签 特点: (1).伪元素由CSS渲染,不会增加DOM开销; (2).伪元素默认为行内样式,可以转化成块级处理; (3).伪元素不管有没有内容,content这是值不能少,即使没有也要写成空; (3).伪元素官方推荐写成双冒号但为了兼 阅读全文
posted @ 2019-09-23 18:50 宅到深夜 阅读(393) 评论(0) 推荐(0)
摘要: 1.定高法 :给父级容器添加高度 2.额外标签法:在浮动元素的后边添加一个块级标签,这个标签专门clear:both 3.伪元素清除浮动 <style> .contain{ width: 500px; border: 1px solid #000; } .box{ width: 300px; hei 阅读全文
posted @ 2019-09-23 18:22 宅到深夜 阅读(134) 评论(0) 推荐(0)
摘要: 1.两侧固定,中间自适应 2.左侧固定,右侧自适应 <style> .contain{ position: relative; height: 200px; padding-left: 200px; } .left{ width: 200px; height: 150px; left:0; top: 阅读全文
posted @ 2019-09-23 17:21 宅到深夜 阅读(604) 评论(0) 推荐(0)
摘要: /*css基础样式*/ /*css样式重置*/ body, div, ul, li, ol, h1, h2, h3, h4, h5, h6, input, textarea, select, p, dl, dt, dd, a, img, button, form, table, th, tr, td, tbody, article, aside, details, figcaption, figu 阅读全文
posted @ 2019-09-23 15:55 宅到深夜 阅读(149) 评论(0) 推荐(0)
摘要: 百分比布局,可以实现宽度自适应 阅读全文
posted @ 2019-09-23 15:34 宅到深夜 阅读(148) 评论(0) 推荐(0)
摘要: 1.左侧固定,右侧自适应 2.右侧固定,左侧自适应 3.两侧固定,中间自适应 阅读全文
posted @ 2019-09-23 14:02 宅到深夜 阅读(507) 评论(0) 推荐(0)
摘要: 概念:触发了BFC的盒子,盒子内部与外部完全隔离,容器内的子元素不会在布局上影响到外部的元素 一.产生BFC的方式: 1.overflow只要取值不是visible的情况 2.float的取值不为none的时候 3.display取值为table或者inline-block 4.position的取 阅读全文
posted @ 2019-09-23 13:00 宅到深夜 阅读(453) 评论(0) 推荐(0)