摘要: 1.top等为绝对定位,需与position:absolute一起用才有效;而margin-top为相对定位; 2.绝对定位一般情况下以body为标准;若父元素设置position:relative,,则以其父元素为标准 阅读全文
posted @ 2017-02-18 20:22 MR_Begin 阅读(1578) 评论(0) 推荐(0) 编辑
摘要: z-index是深度属性,设置元素在z轴上面的堆叠顺序。 强调:z-index必须和定位元素position:absollute|relative|fixed一起使用,否则无效 1.z-index属性(number越大优先级越高) 2.特殊情况 (1)相同z-index: 1)如果两个元素都没有定位 阅读全文
posted @ 2017-02-18 20:11 MR_Begin 阅读(3124) 评论(0) 推荐(0) 编辑
摘要: 方案一:div{font-size:0};方案二:img{ display:block};方案三:img{vertical-align:top;}方案四:div{ margin-bottom:-3px }; 1.为什么img标签上下会有间隙?。 根本原因在于img标签为inline元素,该元素默认垂 阅读全文
posted @ 2017-02-16 21:54 MR_Begin 阅读(10545) 评论(0) 推荐(0) 编辑
摘要: 1.text-align(水平对齐)text-align样式使元素在其定界区域内水平对齐,其取值可以是left、right、center或justify。justify使元素两端对齐。2.vertical-align(垂直对齐)(1)vertical-align基本属性baseline:将支持val 阅读全文
posted @ 2017-02-16 20:50 MR_Begin 阅读(934) 评论(0) 推荐(0) 编辑