|
蓝森林 http://www.lslnet.com 2006年8月25日 8:28
[求码]请问关于美化表单文本输入框的代码
谢谢大侠拉,如题 |
从简单的彩色背景input到登陆框的美化
[html]
<style>
.aaa {background-color: #00CC99;}
</style>
<center>
<input type="text" name="textfield" class="aaa">
<style type="text/css">
input{
BACKGROUND: #ffffff;
COLOR: #000000;
FONT-SIZE: 12px;
border: 1px solid #666666;
}
</style>
<body>
<center>
<form name="form" method="post" target="_blank" action="../reg/entry_submit.jsp">
<span class="ziti">用户名:</span>
<input maxlength=10 name=name size=11 type=text>
<span class="ziti">密 码:</span>
<input maxlength=10 name=pass size=11 type=password>
<INPUT type=submit onMouseUp="document.all.b2.blur();" NAME="b2" VALUE="登陆" BORDER="0" style="BACKGROUND: #CCCCCC; border:1 solid #666666; COLOR: #000000; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 16px; LINE-HEIGHT: normal">
<INPUT type=reset onMouseUp="document.all.b3.blur();" NAME="b3" VALUE="重置" BORDER="0" style="BACKGROUND: #CCCCCC; border:1 solid #666666; COLOR: #000000; FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 16px; LINE-HEIGHT: normal">
<br>
</form>
<br><br><br><br><br>
<style>{font-size:12px}input,fieldset{border:1px solid black;background-Color:#ffffff;}fieldset{width:200px;text-align:center}</style>
<fieldset>
<legend align="center">会员登陆</legend>
<table border="0" cellpadding="5" cellspacing="0">
<tr><td>名称: </td><td><input /></td></tr>
<tr><td>密码: </td><td><input type="password" /></td></tr>
</table>
<input type="button" value="注册"/>
<input type="submit" value="登陆"/>
<input type="reset" value="取消"/>
<br/>
<br/>
</fieldset>
[/html]
|
input外框加颜色
[html]
<style type="text/css">
<!--
.333{
cursor: wait;
filter: Glow(Color=#ffcc99, Strength=6);
}
-->
</style>
<style type="text/css">
<!--
.444 {
cursor: ne-resize;
filter: DropShadow(Color=#0000ff, OffX=2, OffY=2, Positive=1);
}
-->
</style>
<table>
<tr>
<td class="333">
<input type="text" name="textfield">
</td></tr>
</table>
<table>
<tr>
<td class="444">
<input type="text" name="textfield">
</td></tr>
</table>
[/html]
|
感谢,marvellous的回答 |
) 有底色无边框的
[html]<style type="text/css">
<!--
.111 {
background-color: #FF0000;
border: 0px;
}
-->
</style>
<input name="textfield" type="text" class="111">[/html] |
啊!!!谢谢,巴尼,很有特色
|
那请问要让文字在输入框里显示为灰色如何写呢?
input value="i love you"
我想让 I LOVE YOU在输入框内显示为灰色,应该如何做呢,麻烦大虾拉 |
[html]
<style type="text/css">
<!--
.up {
border: 1px solid #ccddff;color:#999999
}
.over {
border: 1px solid #3366ff;color:#333333
}
-->
</style>
<script>
var LastInput=null
var OnInput=0
function chinput(){
if (LastInput!=null && event.srcElement.tagName!="INPUT") {LastInput.className="up";LastInput=null;OnInput=0}
if (event.srcElement.tagName=="INPUT" && event.srcElement.type=="text" && OnInput==0)
{
event.srcElement.className="over"
LastInput=event.srcElement
OnInput=1
}
}
document.onmousemove=chinput
</script>
<input name="textfield" type="text" class="up">
[/html] |
谢谢,puterjam
可是还有一个问题没有解决呢,就是关于文本的 |
|