2021年11月8日
摘要: setTimeout接收的参数函数通过闭包访问变量 i 例 for (var i = 0; i < 5; i++) { setTimeout(function(){ console.log(i) },1000) } // 闭包 实例 for (var i = 0; i < 5; i++) { (fu 阅读全文
posted @ 2021-11-08 20:16 于凡芮 阅读(23) 评论(0) 推荐(0)
  2021年11月7日
摘要: 样式部分: <style> *{ margin: 0; padding: 0; } a{ text-decoration: none; color: #666; } ul li{ display: inline-block; height: 20px; width: 60px; } ul li a{ 阅读全文
posted @ 2021-11-07 20:52 于凡芮 阅读(74) 评论(0) 推荐(0)
摘要: 样式内容: 在父元素和子元素上添加定位 <style> *{ margin: 0; padding: 0; } body{ position: relative; } ul{ width: 1000px; min-width: 600px; margin: 0 auto; list-style: n 阅读全文
posted @ 2021-11-07 20:48 于凡芮 阅读(32) 评论(0) 推荐(0)
摘要: 样式: <style> body{ position: relative;父元素相对定位 } div{ width: 200px; height: 200px; background-color: coral; } span{ position: absolute;子元素绝对定位 top: 10px 阅读全文
posted @ 2021-11-07 20:16 于凡芮 阅读(26) 评论(0) 推荐(0)
摘要: <script> window.onload = function(){ 获取元素方式: // document.getElementById(); // document.getElementsByClassName(); // document.getElementsByName(); // d 阅读全文
posted @ 2021-11-07 20:10 于凡芮 阅读(24) 评论(0) 推荐(0)
  2021年11月5日
摘要: // 字面量json var student={ id:10001, name:"李四", scores:[ {subject:"html",score:90}, {subject:"JS",score:90} ] } // function function Student(id,name){ t 阅读全文
posted @ 2021-11-05 13:05 于凡芮 阅读(28) 评论(0) 推荐(0)
摘要: var reg1=/\d/; var reg2=new RegExp("\d"); /** * \d :0-9任意一个数字 * []:任意一个字符 * [0-9] \d * 12 =>[1][2] 12 * [12a] 1、2、a * [a-zA-Z0-9] * [^]非其中的任意一个字符 * \w 阅读全文
posted @ 2021-11-05 13:04 于凡芮 阅读(70) 评论(0) 推荐(0)
  2021年11月2日
摘要: js的基本语法: //numer 数值,整数,小数 //string 字符串(字符)"" '' //bool true/false //null 没有 //undefined 未定义 //symbol es6 var a; console.log(typeof a) //object:正则、数组 字 阅读全文
posted @ 2021-11-02 18:18 于凡芮 阅读(22) 评论(0) 推荐(0)
  2021年11月1日
摘要: flex-direction属性:flex-direction属性决定主轴的方向(即项目的排列方向)。 它可能有4个值。 1.row(默认值):主轴为水平方向,起点在左端。 2.row-reverse:主轴为水平方向,起点在右端。 3.column:主轴为垂直方向,起点在上沿。 4.column-r 阅读全文
posted @ 2021-11-01 20:17 于凡芮 阅读(74) 评论(0) 推荐(0)
  2021年10月31日
摘要: 1 body{ 2 margin: 0px; 3 padding: 0px; 4 } 5 .content3 .btn{ 6 background-color: #FFFFFF; 7 } 8 .content3 .btn p{ 9 width: 100%; 10 margin:0 auto; 11 阅读全文
posted @ 2021-10-31 20:04 于凡芮 阅读(43) 评论(0) 推荐(0)