您好,欢迎访问三七文档
java基础,html,css,javascript,sql,jdbc,jsp(el,jstl),servlet一,html基本标签!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01//EN=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/title/headbody!--div,span讲css时再讲--!--表单,收集数据--formaction=method=文本框:inputtype=text/br/密码框:inputtype=password/br/单选按钮:inputname=sextype=radio/男inputname=sextype=radiochecked=checked/女br/多选按钮:inputname=favtype=checkbox/篮球inputname=favtype=checkboxchecked=checked/足球inputname=favtype=checkbox/拍球br/文件域:inputtype=file/br/隐藏域:inputtype=hidden/br/文本域:textarea/textareabr/下拉列表:selectoption河南省/optionoptionselected=selected山东省/optionoption四川省/option/select/formbr/hr/pre静夜思床前明月光,疑是地上霜。举头望明月,低头思故乡。/pre!--注释内容--h1标题/h1h6标题/h6font字体/fontimgsrc=test.jpg/oltype=Ili111/lili222/lili333/li/olultype=squareli111/lili222/lili333/li/ul!--table中没有列,一行一行处理--tableborder=1trtd1/tdtdrowspan=32/tdtd3/td/trtrtd4/tdtd6/td/trtrtd7/tdtd9/td/tr/table/body/html框架集详见代码二,css(cascadingstylesheet层叠样式表)html:裸体人css:各种衣服语法:选择器{属性:属性值;...}三种写法:行内式,内嵌式,外链式三种选择器:标签,类,id使用原则:找到哪部分,穿什么衣服1,三种写法行内式,直接写在标签的style属性中h1style=color:red;text-align:right;标题/h1内嵌式,在head标签中,使用style标签headmetahttp-equiv=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/titlestyletype=text/cssh1{color:blue;}/style/headbodyh1标题/h1/body外链式,连接到外部的css文件,在head标签中使用link标签headmetahttp-equiv=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/titlelinktype=text/cssrel=stylesheethref=css.css//head注意:行内式优先级最高2,三种选择器标签选择器,利用标签名选择h1{color:red;}类选择器,利用标签中的class属性.myclass{color:red;}id选择器,利用标签中的id属性#hhh{color:red;}注意,id一般是不重复的综合案例,登录界面!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01//EN=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/titlestyletype=text/css.txt{border-style:solid;border-width:1px;width:150px;height:18px;}.txtred{border-color:red;border-style:solid;border-width:1px;width:150px;height:18px;}.bn1{color:blue;border-style:none;width:82px;height:23px;background-image:url(back1.jpg);}.bn2{color:blue;border-style:none;width:82px;height:23px;background-image:url(back2.jpg);}a{font-size:smaller;text-decoration:none;}a:hover{color:red;font-size:smaller;text-decoration:none;}/style/headbodyform账号:inputonfocus=this.className='txtred'onblur=this.className='txt'class=txttype=text/br/密码:inputonfocus=this.className='txtred'onblur=this.className='txt'class=txttype=password/br/inputclass=bn1onmousemove=this.className='bn2'onmouseleave=this.className='bn1'type=submitvalue=登录/ahref=#忘记密码?/a/form/body/html三,javascript(ajax,webservice)存在意义:控制页面元素使用原则:找到谁,做啥script是NetScape网景公司的产品,吸取了java的语法精华,更名为javascriptVBScript,基于VB的脚本语言JScript,微软公司的产品,1,helloworld!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01//EN=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/titlescripttype=text/javascriptalert(helloworld);/script/headbody/body/html2,基本语法(1)变量申明,统一用var,弱类型(2)面向对象(属性,方法),方法(也叫函数)javascript的函数是通过元素事件触发的scripttype=text/javascriptfunctiontest(){alert(哈哈哈);}/script/headbodybuttononclick=test()点我试试/button/body特例,伪URL调用函数URL:网址,统一资源定位符UniformResourceLocatorahref=javascript:test()再点试试/a案例,简单计算器!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01//EN=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/titlescripttype=text/javascriptfunctionjisuan(){varn1=parseInt(document.getElementById(n1).value);varn2=parseInt(document.getElementById(n2).value);varop=document.getElementById(op).value;varres=0;if(op==+){res=n1+n2;}elseif(op==-){res=n1-n2;}elseif(op==*){res=n1*n2;}else{if(n2==0){alert(除数不能为零);return;}res=n1/n2;}document.getElementById(res).value=res;}/script/headbodyinputid=n1type=text/selectid=opoptionvalue=++/optionoptionvalue=--/optionoptionvalue=**/optionoptionvalue=///option/selectinputid=n2type=text/buttononclick=jisuan()=/buttoninputid=restype=text//body/html3,javascript常用内置对象(和java类似)(1)Date对象,Date对象用于处理日期和时间(2)Math对象,Math对象用于执行数学任务(3)Array对象,Array对象用于在单个的变量中存储多个值案例,禁止页面复制bodyonselectstart=returnfalsep内容内容内容内容内容内容内容内容内容内容内容内容/pp内容内容内容内容内容内容内容内容内容内容内容内容/pp内容内容内容内容内容内容内容内容内容内容内容内容/p/body案例,验证码!DOCTYPEHTMLPUBLIC-//W3C//DTDHTML4.01//EN=Content-Typecontent=text/html;charset=utf-8titleUntitledDocument/titlestyletype=text/css#key{background-color:black;color:yellow;border:none;width:50px;height:18px;}/stylescripttype=text/javascriptfunctioncreateKey(){varstr=0123456789abcdefghighlmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ;vars=;//单个字符varss=;//最
本文标题:,html,css,javascript,sql,jdbc,jsp(el,jstl),servlet
链接地址:https://www.777doc.com/doc-4117997 .html