04 2020 档案
摘要:var car = { color:'red', speed:80, weight:1.5, diver: function (n) { console.log(n*this.speed+'千米'); } }//定义对象,var 对象名 = {},大括号内为对象的属性,一个属性名对应一个属性值,属性
阅读全文
摘要:function dg(x) { if (x==1) { return 1; } else if (x==2) { return 1; } else { return dg(x-1)+dg(x-2); } } //递归,函数内部调用自己,例如波菲那契就是一个典型的递归,当x>=3时,函数返回值为前两
阅读全文
摘要:var nm = function(){ console.log('这是匿名函数'); } nm(); //匿名函数,函数声明时没有函数名,使用时必须在声明函数的下面,否则将会按照未声明的变量处理报错 !function(){ console.log('自执行函数1'); }(); (functio
阅读全文
摘要:var i = 5; var j = i++; var j1 = ++i; //这里j = i++;先算j = i,再算i = i + 1,所以j = 5,i = 6 //j1 = ++i;先算i = i + 1,再算j = i,所以j = 6,i = 6 var
阅读全文
摘要:/*<script src="./js/js.js"></script>外部引入js文件方法,将此条写在head标签内 <script type="text/javascript"> function name() { alert("点我干嘛?") } </script>内部引入js方法,直接在he
阅读全文
摘要:.a{ border: solid #000000 1px; width: 200px; height: 200px; background-color: tomato;}@media screen and (min-width:600px){ .a{ display: none;/*最小宽度600
阅读全文
摘要:.box{ background-color: brown; width: 200px; height: 200px; border-radius: 5px 10px 25px 40px;/*圆角,四个像素从左上到左下顺时针设定,像素越大越圆*/ border: 1px black solid; b
阅读全文
摘要:*{ background-color: burlywood;/*通配符选择器,与body选择器类似*/ } div,p{ font-size: 15px;/*选择器分组*/ } div p{ color: blue;/*后代选择器*/ } div>p{ font-style: italic;/*子
阅读全文
摘要:文本样式(以下代码都在CSS文件中) p{ width: 300px; text-indent: 10px;缩进大小 text-align: center;水平对齐方式 text-decoration: overline/underline/line-through;上划线、下划线、删除线 whit
阅读全文
摘要:音频视频 <audio src="路径" controls="controls" loop(自动循环) autoplay(进入页面自动播放) muted(静音)> <video src="路径" controls="controls"> CSS样式表引用方式 <div style="color: r
阅读全文
摘要:框架 <iframe src="CSS1.html" frameborder="0" width="1000" height="600"></iframe> <iframe src="表格.html" frameborder="0" width="800" height="500"></iframe
阅读全文
浙公网安备 33010602011771号