摘要: [1] slientWidth 和 sclientHeight slientWidth:获取的是可视宽度 slientHeight:获取的是可视高度 <html> <head> <style> .div1{ width:50px; height:50px; overflow:scroll; //设置 阅读全文
posted @ 2016-07-19 17:16 924256520 阅读(1069) 评论(0) 推荐(0) 编辑
摘要: <html> <head> <style type="text/css"> .div2{ font-size:16px; color:orange; } .div3{ font-size:20px; color:blue; } <style> <script type="text/javascrip 阅读全文
posted @ 2016-07-19 16:31 924256520 阅读(7057) 评论(1) 推荐(0) 编辑
摘要: <html> <head> <link rel="stylesheet" type="text/css" href="basic.css"> <script> window.onload=function(){ var sheet=document.styleSheets[0]; //【新增样式规则 阅读全文
posted @ 2016-07-19 15:27 924256520 阅读(713) 评论(0) 推荐(0) 编辑
摘要: [动态添加css样式] <html> <head> <script type="text/javascript"> window.onload=function(){ var head=document.getElementsByTagName('head')[0]; //获取到head元素 var 阅读全文
posted @ 2016-07-19 14:48 924256520 阅读(4359) 评论(0) 推荐(0) 编辑