day27

1div的高宽等于浏览器可见区域的高宽,浏览器滚动,div始终覆盖浏览器的整个可见区域
2.	<html>
3.	<head>
4.	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5.	<title>前端试题(html3/4)</title>
6.	<style type="text/css">
7.	html, body {height:100%;width:100%;margin:0;overflow:hidden;}
8.	#fullDiv {width:100%;height:100%;top:0px;left:0px;position:absolute;background:#eee;border:1px solid red;}
9.	#body {width:100%;height:100%;overflow:auto;z-index:999;position:absolute;top:0px;left:0px;}
10.	</style>
11.	</head>
12.	<body>
13.	<input type="background:red;position:absolute;left:100px;"></input>
14.	<!--div的高宽等于浏览器可见区域的高宽,浏览器滚动,div始终覆盖浏览器的整个可见区域-->
15.	<!--input type="text" style="background:red;"/-->
16.	<div id="fullDiv"></div>
17.	<div id="body">
18.	<div style="height:1000px;border:1px solid black;background:#ee0;position:absolute;"></div>
19.	</div>
20.	<script type="text/javascript">
21.	function getBrowerSize() {
22.	    if(document.compatMode == "BackCompat"){
23.	        cWidth = document.body.scrollWidth;
24.	        cHeight = document.body.scrollHeight;
25.	    }
26.	    else {
27.	        cWidth = document.documentElement.scrollWidth;
28.	        cHeight = document.documentElement.scrollHeight;
29.	    }
30.	    return {width:(cWidth-21)+"px", height:(cHeight - 4)+"px"};
31.	}
32.	var floatDiv = document.getElementByIdx_x_x_x('fullDiv');
33.	alert("width:"+size.width+"    height:"+size.height);
34.	floatDiv.style.height = size.height;
35.	floatDiv.style.width = size.width;
36.	</script>
37.	</body>
38.	</html>

2
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
答案:
select year, 
(select amount from aaa m where month=1 and m.year=aaa.year) as m1,
(select amount from aaa m where month=2 and m.year=aaa.year) as m2,
(select amount from aaa m where month=3 and m.year=aaa.year) as m3,
(select amount from aaa m where month=4 and m.year=aaa.year) as m4
from aaa group by year

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

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

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

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

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

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

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章