摘要:
<div style="width:100%; margin:0 auto;"> <div style="width:200px; float:right; background-color:#960">这是右侧的内容 固定宽度</div> <div style="width:150px; floa 阅读全文
摘要:
选择器类型 1、ID #id 2、class .class 3、标签 p 4、通用 * 5、属性 [type="text"] 6、伪类 :hover 7、伪元素 ::first-line 8、子选择器、相邻选择器 三、权重计算规则 1. 第一等:代表内联样式,如: style=””,权值为1000。 阅读全文
摘要:
数组: 1.push(): 向数组尾部添加一个或多个元素,并返回添加新元素后的数组长度。注意,该方法会改变原数组。 1 var arr = [1,2,3]; 2 console.log(arr); // [1, 2, 3] 3 var b = arr.push(4); 4 console.log(b 阅读全文
摘要:
垂直居中是布局中十分常见的效果之一,为实现良好的兼容性,PC端实现垂直居中的方法一般是通过绝对定位,table cell,负边距等方法。有了css3,针对移动端的垂直居中就更加多样化。 方法1:table cell html结构: 垂直居中 css: .box1{ display: table ce 阅读全文