多个网页设计常用技巧代码Word下载.docx
- 文档编号:6362707
- 上传时间:2023-05-06
- 格式:DOCX
- 页数:25
- 大小:26.98KB
多个网页设计常用技巧代码Word下载.docx
《多个网页设计常用技巧代码Word下载.docx》由会员分享,可在线阅读,更多相关《多个网页设计常用技巧代码Word下载.docx(25页珍藏版)》请在冰点文库上搜索。
#666666。
height:
17px。
width:
25pt。
font-size:
9pt。
BACKGROUND-COLOR:
#E8E8FF。
color:
#666666"
5.按钮颜色变化
inputtype=textname="
nick"
style="
1pxsolid#666666。
#F4F4FF。
#ff6600"
size="
15"
maxlength="
16"
6.平面输入框
T1"
20"
border-style:
solid。
border-width:
1"
7.使窗口变成指定的大小
script>
window.resizeTo(300,283)。
/script>
8.使文字上下滚动
marqueedirection=upscrollamount=1scrolldelay=100onmouseover='
this.stop()'
onmouseout='
this.start()'
height=60>
!
--head_scrolltext-->
tr>
td>
共和国
/table>
<
--endhead_scrolltext-->
/marquee>
9.状态栏显示该页状态
baseonmouseover="
window.status='
网站建设/'
。
returntrue"
10.可以点击文字实现radio选项的选定
br>
<
radio"
regtype"
A03"
id="
labelfor="
情侣:
一次注册两个帐户<
/label>
11.可以在文字域的font写onclick事件
12.打印<
/a>
打印网页
ahref='
javascript:
window.print()'
13.线型输入框
key"
12"
关键字"
onFocus=this.select()onMouseOver=this.focus()
class="
line"
14.显示文档最后修改日期
scriptlanguage=javascript>
functionhi(str)
{
document.write(document.lastModified)
alert("
hi"
+str+"
"
)
}
15.可以在鼠标移到文字上时就触发事件
html>
head>
scriptlanguage="
Livescript"
--Hiding
functionhello(){
alert("
哈罗!
)。
}
/head>
body>
ahref="
onMouseOver="
hello()"
link<
/body>
/html>
16.可以根据网页上的选项来确定页面颜色
HTML>
HEAD>
TITLE>
background.html<
/TITLE>
/HEAD>
--
functionbgChange(selObj){
newColor=selObj.options[selObj.selectedIndex].text。
document.bgColor=newColor。
selObj.selectedIndex=-1。
//-->
BODYSTYLE="
font-family:
Arial"
B>
ChangingBackgroundColors<
/B>
BR>
FORM>
SelectSIZE="
8"
onChange="
bgChange(this)。
OPTION>
Red
Orange
Yellow
Green
Blue
Indigo
Violet
White
pink
/Select>
/FORM>
/BODY>
/HTML>
17.将按钮的特征改变
styletype="
text/css"
.style1{font-size:
12px。
background:
#CCCCFF。
thinthinthinthin。
border-color:
#CCCCFF
#CCCCCC#CCCCCC#CCCCFF}
.style2{font-size:
font-weight:
bold。
#CCFFCC。
thinmediummediumthin。
border-color:
#CCFF99#999999#999999#CCFF99}
-->
/style>
本例按钮的代码如下:
Submit"
提交"
onmouseover="
this.className='
style2'
onmouseout="
style1'
style1"
18.改变按钮的图片.
.style3{font-size:
url(image/buttonbg1.gif)。
border:
0px。
60px。
22px}
.style4{font-size:
url(image/buttonbg2.gif)。
0px0。
60px。
本例的按钮代码如下:
Submit2"
style4'
style3'
style3"
19.打印页面
divalign="
center"
<
aclass=contenthref="
doPrint()。
打印本稿<
/div>
20.可以直接写html语言
document.write("
21.改变下拉框的颜色
selectname="
classid"
onChange="
changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)"
size="
1"
color:
#008080。
font-size:
9pt"
22.转至目标URL
window.location="
http:
//guoguo"
23.传递该object的form
UpdateSN('
guoqiang99267'
this.form)
functionUpdateSN(strValue,strForm)
strForm.SignInName.value=strValue。
returnfalse。
24.文字标签
AltName4"
inputname="
AltName"
type="
RADIO"
tabindex="
931"
>
guoqiang99859<
25.layer2为组件的ID,可以控制组件是否可见
document.all.item('
Layer2'
).style.display="
block"
。
none"
//
26.将页面加入favorite中
functionAddme(){
url="
//your.site.address"
//你自己的主页地址
title="
YourSiteName"
//你自己的主页名称
window.external.AddFavorite(url,title)。
27.过10秒自动关闭页面
scriptlanguage="
Javascript"
>
functioncloseit(){
setTimeout("
self.close()"
,10000)
/script>
28.可以比较字符的大小
char=post.charAt(i)。
if(!
('
0'
=char&
&
char<
='
9'
))
29.将字符转化为数字
month=parseInt(char)
30.点击value非空的选项时转向指定连接
selectonchange='
if(this.value!
="
)window.open(this.value)'
textinput"
optionselected>
主办单位<
/option>
option>
-----------------<
optionvalue="
/select>
31.改变背景颜色
tdwidth=*class=dpbgColor=#FAFBFConmouseover="
this.bgColor='
#FFFFFF'
#FAFBFC'
32.改变文字输入框的背景颜色
style>
.input2{background-image:
url('
../images/inputbg.gif'
background-color:
#D0DABB。
border-top-width:
1px。
border-right-width:
1px。
border-bottom-width:
border-left-width:
1px}
inputname=contenttype=textsize="
47"
input2"
50"
33.改变水平线的特征
hrsize="
0"
noshadecolor="
#C0C0C0"
34.传递参数的方式
vote.asp?
CurPage=8&
id=3488"
8<
35.页内跳转
#1"
1<
#2"
2<
#3"
3<
#4"
4<
#5"
5<
#6"
6<
#7"
7<
aname="
dfdf<
2"
36.两个按键一起按下
if(event.ctrlKey&
window.event.keyCode==13)//
37.刷新页面
javascript:
this.location.reload()//
38.将网页的按钮使能
scriptLANGUAGE="
functionhaha()
for(vari=0。
i<
document.form1.elements.length。
i++)
if(document.form1.elements[i].name.indexOf("
bb"
)!
=-1)
document.form1.elements[i].disabled=!
document.form1.elements[i].disabled。
BODY>
formname=form1>
INPUTTYPE="
NAME="
aa"
value=cindyonclick=haha()>
bb"
value=guoguo>
39.文字移动
marqueescrollamount=3onmouseover=this.stop()。
onmouseout=this.start()。
40.双击网页自动跑
varcurrentpos,timer。
functioninitialize()
timer=setInterval("
scrollwindow()"
1)。
functionsc()
clearInterval(timer)。
functionscrollwindow()
currentpos=document.body.scrollTop。
window.scroll(0,++currentpos)。
if(currentpos!
=document.body.scrollTop)
sc()。
document.onmousedown=sc
document.ondblclick=initialize
41.后退
onclick=window.history.back()value=back>
42.前进
onclick=window.history.forward()value=forward>
43.刷新
onclick=document.location.reload()value=reload>
44.转向指定网页
document.location="
//ww"
或者document.location.assign("
45.在网页上显示实时时间
varclock_id。
window.onload=function()
clock_id=setInterval("
document.form1.txtclock.value=(newDate)。
1000)
46.可以下载文件
document.location.href="
目标文件"
47.连接数据库
importjava.sql.*。
StringmyDBDriver="
sun.jdbc.odbc.JdbcOdbcDriver"
Class.forName(myDBDriver)。
Connectionconn=DriverManager.getConnection("
jdbc:
odbc:
firm"
"
username"
password"
Statementstmt=conn.createStatement()。
ResultSetrs=stmt.executeQuery(sql)。
rs.getString("
column1"
48.可以直接在页面“div”内写下所需内容
onclick="
a1.innerHTML='
fontcolor=red>
*<
/font>
divid=a1>
49.可以改变页面上的连接的格式,使其为双线
A:
link{text-decoration:
none。
#0000FF。
font-family:
宋体}
visited{text-decoration:
#0000FF。
hover{text-decoration:
underlineoverline。
FF0000}
underlineoverlineline-through。
TH{FONT-SIZE:
9pt}
TD{FONT-SIZE:
body{SCROLLBAR-FACE-COLOR:
#A9D46D。
SCROLLBAR-HIGHLIGHT-COLOR:
#e7e7e7。
SCROLLBAR-SHADOW-COLOR:
#e7e7e7。
SCROLLBAR-3DLIGHT-COLOR:
#000000。
LINE-HEIGHT:
15pt。
SCROLLBAR-ARROW-COLOR:
#ffffff。
SCROLLBAR-TRACK-COLOR:
}
INPUT{BORDER-TOP-WIDTH:
PADDING-RIGHT:
PADDING-LEFT:
BORDER-LEFT-WIDTH:
FONT-SIZE:
9pt。
BORDER-LEFT-COLOR:
#cccccc。
BORDER-BOTTOM-WIDTH:
BORDER-BOTTOM-COLOR:
PADDING-BOTTOM:
BORDER-TOP-COLOR:
PADDING-TOP:
HEIGHT:
18px。
BORDER-
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 网页 设计 常用 技巧 代码