很多站长朋友们都不太清楚html怎么给按钮加文字,今天小编就来给大家整理html怎么给按钮加文字,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 html 提交按钮如何加入图片呢 或图片按钮如何加入文字如图 2、 我想用html语句实现一个点击按钮,在文本输入框内光标处加入一段文字。 3、 html怎么做出点一个按钮,就弹出一段文字的窗口效果? 4、 html怎么在文本框里面输入文字 html 提交按钮如何加入图片呢 或图片按钮如何加入文字如图用img做图片按钮的方法。。图片就是你的图片,下载后改名为img.jpg保存在同一级目录就行了。
注意,如果要用图片做按钮,必须要保证,你那个input的border为none,而且那个input必须要有宽和高。
这种方法仅供参考。。。还是建议你直接用<input type="image" src="">这种。。图片上ps上文字,不过,用背景img也不错,至少减少了服务器的压力。。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric//EN"
"
<html xmlns="
<head>
<title>新建网页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<style type="text/css">
#bimg {
background:url(img.jpg) -60px -40px;
width:125px;
height:30px;
border:none;
font-weight:bold;
color:white;
}
</style>
</head>
<body>
<form method="GET" action="">
<input type="text" name="mae" value="wca">
<input id="bimg" type="submit" value="提交">
</form>
</body>
</html>
我想用html语句实现一个点击按钮,在文本输入框内光标处加入一段文字。<input name="wdf" type="text" id="wdf">
<input type="button" onClick="wdf.value='这是加入的文字'" value="按钮">
是这样的效果吗?
如果是的话,你把“onClick="wdf.value='这是加入的文字''"”这一句的那个单引号“'”的内容改成你想加入的文字就可以了
html怎么做出点一个按钮,就弹出一段文字的窗口效果?html做点一个按钮就弹出文字的代码:
最基本的弹出窗口代码
<SCRIPT LANGUAGE="javascript">
<!-- window.open ('page.html') --> </SCRIPT>
经过设置后的弹出窗口
<SCRIPT LANGUAGE="javascript">
<!-- window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //-->
</SCRIPT>
用函数控制弹出窗口
<html>
<head>
<script LANGUAGE="JavaScript">
<!-- function openwin() { window.open ("page.html", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //} //-->
</script>
</head>
<body onload="openwin()">
</body>
</html>
同时弹出2个窗口
<script LANGUAGE="JavaScript">
<!-- function openwin() { window.open ("page.html", "newwindow", "height=100, width=100, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=n o, status=no")//window.open ("page2.html", "newwindow2", "height=100, width=100, top=1 00, left=100,toolbar=no, menubar=no, scrollbars=no, resizable=no, loca tion=no, status=no")//} //-->
</script>
主窗口打开文件1.htm,同时弹出小窗口page.html
如下代码加入主窗口<head>区:
<script language="javascript">
<!-- function openwin() { window.open("page.html","","width=200,height=200") } //-->
</script>
加入<body>区: <a href="1.htm" onclick="openwin()">open</a>
弹出的窗口之定时关闭控制
首先,将如下代码加入page.html文件的<head>区:
<script language="JavaScript">
function closeit()
{ setTimeout("self.close()",10000) //毫秒 }
</script>
在弹出窗口中加上一个关闭按钮
<FORM>
<INPUT TYPE='BUTTON' VALUE='关闭' onClick='window.close()'>
</FORM>
内包含的弹出窗口-一个页面两个窗口
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function openwin()
{ OpenWindow=window.open("", "newwin", "height=250, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");
//OpenWindow.document.write("<TITLE>例子</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR=#ffffff>")
OpenWindow.document.write("<h1>Hello!</h1>")
OpenWindow.document.write("New window opened!")
OpenWindow.document.write("</BODY>")
OpenWindow.document.write("</HTML>")
OpenWindow.document.close() }
</SCRIPT>
</head>
<body>
<a href="#" onclick="openwin()">打开一个窗口</a>
<input type="button" onclick="openwin()" value="打开窗口">
</body>
</html>
终极应用--弹出的窗口之Cookie控制
首先,将如下代码加入主页面HTML的<HEAD>区:
<script>
function openwin(){
window.open("page.html","","width=200,height=200") }
function get_cookie(Name) { var search = Name + "=" var returnvalue = "";
if (document.cookie.length > 0) { offset = document.cookie.indexOf(search)
if (offset != -1) { offset += search.length end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end)) } }
return returnvalue; }
function loadpopup(){ if (get_cookie('popped')==''){ openwin()
document.cookie="popped=yes" } }
</script>
Asp教程-ASP应用
this.Response.Write(<Script>window.open('WebForm7.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=470,left=80,top=40');</script>");
弹出跟你当前的窗口有没有菜单工具栏没有关系,你只要在页面中写一个脚本它就弹出了.比如
<a href=# onclick="window.open('xxx.aspx','窗口名称','参数');">xxxxx</a>
以下列出一些弹出窗口的参数:
(如:"fullscreen=yes, toolbar=yes")。下面是被支持的各种特性。
channelmode = { yes | no | 1 | 0 } 是否在窗口中显示阶梯模式。默认为no。
directories = { yes | no | 1 | 0 } 是否在窗口中显示各种按钮。默认为yes。
fullscreen = { yes | no | 1 | 0 } 是否用全屏方式显示浏览器。默认为no。
height = number 指定窗口的高度,单位是像素。最小值是100。
left = number 指定窗口距左边框的距离,单位是像素。值必须大于或者等于0。
location = { yes | no | 1 | 0 } 指定是否在窗口中显示地址栏。默认为yes。
menubar = { yes | no | 1 | 0 } 指定是否在窗口中显示菜单栏。默认为yes。
resizable = { yes | no | 1 | 0 } 指定是否在窗口中显示可供用户调整大小的句柄。默认为yes。
scrollbars = { yes | no | 1 | 0 } 指定是否在窗口中显示横向或者纵向滚动条。默认为yes。
status = { yes | no | 1 | 0 } 指定是否在窗口中显示状态栏。默认为yes。
titlebar = { yes | no | 1 | 0 } 指定是否在窗口中显示标题栏。在非调用HTML Application或者一个对话框的情况下,这一项将被忽略。默认为yes。
toolbar = { yes | no | 1 | 0 } 指定是否在窗口中显示工具栏,包括如前进、后退、停止等按钮。默认为yes。
top = number 指定窗口顶部的位置,单位是像素。值必须大于或者等于0。
width = number 指定窗口的宽度,单位是像素。最小值是100。
html怎么在文本框里面输入文字<html>
<body>
<form action="/example/html/form_action.asp" method="get">
<p>First name: <input type="text" name="fname" /></p>
<p>Last name: <input type="text" name="lname" /></p>
<input type="submit" value="Submit" />
</form>
<p>请单击确认按钮,输入会发送到服务器上名为 "form_action.asp" 的页面。</p>
</body>
</html>
用的是INPUT标签。
input标签后面的type是输入的类型
type="text"是文本输入框
type="submit"是提交按钮
他会被标记为一个类似于变量的结构
name后面就使用输入数值的时候的名字
关于html怎么给按钮加文字的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于html怎么给按钮加文字 如何在html中添加文字的详细内容...