Day027

1.      div的高宽等于浏览器可见区域的高宽,浏览器滚动,div始终覆盖浏览器的整个可见区域

[html] view plain copy
  1. 1.<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  2.   
  3. 2.     <html>  
  4.   
  5. 3.     <head>  
  6.   
  7. 4.     <metahttp-equivmetahttp-equiv="Content-Type" content="text/html;charset=UTF-8">  
  8.   
  9. 5.     <title>前端试题(html3/4)</title>  
  10.   
  11. 6.     <styletypestyletype="text/css">  
  12.   
  13. 7.     html, body{height:100%;width:100%;margin:0;overflow:hidden;}  
  14.   
  15. 8.     #fullDiv {width:100%;height:100%;top:0px;left:0px;position:absolute;background:#eee;border:1pxsolid red;}  
  16.   
  17. 9.     #body{width:100%;height:100%;overflow:auto;z-index:999;position:absolute;top:0px;left:0px;}  
  18.   
  19. 10.  </style>  
  20.   
  21. 11.  </head>  
  22.   
  23. 12.  <body>  
  24.   
  25. 13.  <inputtypeinputtype="background:red;position:absolute;left:100px;"></input>  
  26.   
  27. 14.  <!--div的高宽等于浏览器可见区域的高宽,浏览器滚动,div始终覆盖浏览器的整个可见区域-->  
  28.   
  29. 15.  <!--input type="text"style="background:red;"/-->  
  30.   
  31. 16.  <dividdivid="fullDiv"></div>  
  32.   
  33. 17.  <div id="body">  
  34.   
  35. 18.  <divstyledivstyle="height:1000px;border:1px solidblack;background:#ee0;position:absolute;"></div>  
  36.   
  37. 19.  </div>  
  38.   
  39. 20.  <scripttypescripttype="text/javascript">  
  40.   
  41. 21.  function getBrowerSize() {  
  42.   
  43. 22.      if(document.compatMode =="BackCompat"){  
  44.   
  45. 23.          cWidth = document.body.scrollWidth;  
  46.   
  47. 24.          cHeight = document.body.scrollHeight;  
  48.   
  49. 25.      }  
  50.   
  51. 26.      else {  
  52.   
  53. 27.          cWidth = document.documentElement.scrollWidth;  
  54.   
  55. 28.          cHeight =document.documentElement.scrollHeight;  
  56.   
  57. 29.      }  
  58.   
  59. 30.      return{width:(cWidth-21)+"px", height:(cHeight - 4)+"px"};  
  60.   
  61. 31.  }  
  62.   
  63. 32.  var floatDiv =document.getElementByIdx_x_x_x('fullDiv');  
  64.   
  65. 33.  alert("width:"+size.width+"    height:"+size.height);  
  66.   
  67. 34.  floatDiv.style.height =size.height;  
  68.   
  69. 35.  floatDiv.style.width = size.width;  
  70.   
  71. 36.  </script>  
  72.   
  73. 37.  </body>  
  74.   
  75. 38.  </html>  

 

2.怎么把这样一个表

year month amount
1991 1 1.1
1991 2 1.2
1991 3 1.3
1991 4 1.4
1992 1 2.1
1992 2 2.2
1992 3 2.3
1992 4 2.4
查成这样一个结果
year m1 m2 m3 m4
1991 1.1 1.2 1.3 1.4
1992 2.1 2.2 2.3 2.4


  1. select year,   
  2. (select amount from aaa m where month=1 and m.year=aaa.year) asm1,  
  3. (select amount from aaa m where month=2 and m.year=aaa.year) asm2,  
  4. (select amount from aaa m where month=3 and m.year=aaa.year) asm3,  
  5. (select amount from aaa m where month=4 and m.year=aaa.year) asm4  
  6. from aaa group by year  

 

3.抽象类遵循的原则有哪些?

 


(1)abstract关键字只能修饰类和方法,不能修饰字段。

(2)抽象类不能被实例化(无法使用new关键字创建对象实例),只能被继承。

(3)抽象类可以包含属性,方法,构造方法,初始化块,内部类,枚举类,和普通类一样,普通方法一定要实现,变量可以初始化或不初始化但不能初始化后在抽象类中重新赋值或操作该变量(只能在子类中改变该变量)。

(4)抽象类中的抽象方法(加了abstract关键字的方法)不能实现。

(5)含有抽象方法的类必须定义成抽象类。

猜你喜欢

转载自blog.csdn.net/zhou_jiepeng/article/details/80797130