书签 分享 收藏 举报 版权申诉 / 12

类型网页的基本结构.docx

  • 文档编号:10744945
  • 上传时间:2023-05-27
  • 格式:DOCX
  • 页数:12
  • 大小:17.96KB

盒子2

网页布局设计

标准文档流

行内元素从左到右解析文档

块级元素从上到下解析元素

Display属性可以改变元素的性质

 

盒子的定位

title>盒子的定位

#wrapper

{

border:

1pxsolidblack;

}

#box1,#box2,#box3

{

border:

1pxsolidblack;

margin:

5px;

height:

40px;

width:

300px;

}

#box1

{

background-color:

red;

color:

yellow;

position:

absolute;/*绝对定位脱离标准文档流*/

top:

30px;

left:

100px;

}

#box2

{

background-color:

green;

color:

white;

position:

relative;/*相对原来的位置进行偏移*/

left:

50px;

top:

-20px;

}

#box3

{

background-color:

yellow;

color:

black;

position:

fixed;/*固定定位*/

top:

30px;

left:

100px;

}

第一个层

第二个层

第三个层

 

盒子的浮动

Float:

left;

Clear:

both;overflow:

hidden解决浮动塌陷

常用流行布局的实现

自适应width:

80%当改变窗口的大小时,页面内容始终是窗口的80%

JavaScript基础知识

定义函数

functiongetArea(width,height)

{

varre=width*height;

returnre;

/*document.write("面积:

"+re);*/

}

vararea=getArea(3,4);

document.write(area);

系统函数

varr=parseInt("123")+parseFloat("456");

document.write(r);

varx="ABC";

vary=123;

document.write(isNaN(y));

输入x返回true表示x不是数字

Varr=””1+2+3+4;

r=eval(r);

document.write(r);

eval返回运算数的计算结果

匿名函数

(function(width,height){document.write("面积:

"+width*height);})

(3,4)

函数也是一种数据类型function类型

匿名函数作为函数的参数来传递

Vararea=function(width,height){

Document.write(“面积:

”+width*height);

};

Area(3,4);

常用事件、

functionfun(obj)

{

obj.style.fontSize="30px";

}

事件绑定

This表示事件源p;

window.onload=function(){alert("欢迎来到美淘网");}

(1).jpg"width="300"height="300"alt="1"/>

浏览器默认处理程序

functionCheck()

{

event.returnValue=false;

}

functionCheck()

{

varusername=document.getElementById("name").value;

if(username=="")

{

alert("请输入用户名");

returnfalse;

}

returntrue;

}

window对象

window.alert();

varname=window.prompt("请输入姓名:

");

window.alert("欢迎"+name);

确认对话框

varflag=window.confirm("确认删除吗?

");

if(flag)

window.alert("执行删除操作");

else

window.alert("取消删除操作");

 

varnewWin;

window.onload=function()

{newWin=window.open("index.html","index","");

}

newWin.close()">关闭窗口

闹钟函数

/*setTimeout("alert('Hello')",2000);*/

setInterval("alert('Hello')",6000);

 

感谢下载!

 

欢迎您的下载,资料仅供参考

 

举报
举报
版权申诉
版权申诉
word格式文档无特别注明外均可编辑修改;预览文档经过压缩,下载后原文更清晰! 立即下载
配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
网页 基本 结构
提示  冰点文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:网页的基本结构.docx
链接地址:https://www.bingdoc.com/p-10744945.html
相关搜索
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2


收起
展开