html如何设置input的无边框效果 html如何设置input的无边框效果 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CSS可以控制的<style type="text/css">input {border:1px solid #c00;}input {star : expression(onmouseover=function(){this.style.borderColor="#060"},onmouseout=function(){this.style.borderColor="#c00"})}</style> CSS<style type="text/css">input{ border-top:0px ; border-left:0px ; border-right:0px ;}</style> CSS就好比穿上一件漂亮的衣服,起到装饰效果 在 CSS 中使用 IE 中特有的 expression 是很不好的做法,因为这种方式只有 IE 支持,其他浏览器不能支持这种方式。<html><head> <meta http-equiv="Content-Type" content="text/html; charset=gbk" /> <title>试试</title></head><script type="text/javascript">function chanageBackColor(tag) { var txts = document.getElementsByTagName(tag); for(var i = 0; i < txts.length; i++) { if(tag == 'input' && txts[i].type != 'text') { continue; } txts[i].isfocus = false; txts[i].onmouseover = function() { this.style.backgroundColor = '#fffacd'; } txts[i].onfocus = function() { this.isfocus = true; this.style.backgroundColor = '#fffacd'; this.style.borderColor = 'red'; } txts[i].onmouseout = function() { if(!this.isfocus) { this.style.backgroundColor = '#ffffff'; } } txts[i].onblur = function() { this.style.backgroundColor = '#ffffff'; this.style.borderColor = '#c0c0c0'; this.isfocus = false; } }}window.onload = function() { chanageBackColor('input'); chanageBackColor('textarea');}</script><style type="text/css">form table { font-size: 10pt;}form table td.top { vertical-align: top;}form table td.td-r { text-align: right;}input.txt { width: 300px; border: 1px solid #c0c0c0; padding: 2px 2px;}textarea { font-size: 10pt; height: 100px; width: 300px; border: 1px solid #c0c0c0; overflow-y: auto; padding: 2px;}</style><body><form name="frm" method="post" action="#" onsubmit="return checkMobile();"> <table> <tr> <td class="td-r">姓名:</td> <td><input type="text" name="name" class="txt"></td> </tr> <tr> <td class="td-r">主页:</td> <td><input type="text" name="page" class="txt"></td> </tr> <tr> <td class="td-r">验证码:</td> <td><input type="text" name="code" class="txt"></td> </tr> <tr> <td class="td-r top">内容:</td> <td><textarea name="comment"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" value="确定"></td> </tr> </table></form></body></html> 无边框Input:<input type="text" style="border:1px;border-bottom-style:none;border-top-style:none;border-left-style:none;border-right-style:none;"> <style type="text/css"><!--input { border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000;}--></style><input type="text" name="textfield" id="textfield" />这个是我刚写的一个在下边有条线 如果你不想要这条线的话 你可以把border-bottom-width: 1px;改成border-bottom-width: 0px;就可以了 取字符串固定位数问题 正则FIND()方法 菜鸟学JAVA:用JDBCODB连接ACCESS时需要装JDBCODBC驱动吗?怎么装,去哪下载?? application或applet怎样通过http上传文件? 给JTable加横向的ScrollBar IQ面试题 有关arrays的一个简单问题 Java 多线程 面临职业选择前景, 犹豫中, 请大家给把个脉 哪里有visual cafe可以下载?80分送上,在线等待 关于工厂方法模式的一点疑问~!~! 求助啊--关于arraylist的
<style type="text/css">
input {border:1px solid #c00;}
input {star : expression(
onmouseover=function(){this.style.borderColor="#060"},
onmouseout=function(){this.style.borderColor="#c00"})}
</style>
<style type="text/css">
input
{
border-top:0px ;
border-left:0px ;
border-right:0px ;
}
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>试试</title>
</head><script type="text/javascript">
function chanageBackColor(tag) {
var txts = document.getElementsByTagName(tag);
for(var i = 0; i < txts.length; i++) {
if(tag == 'input' && txts[i].type != 'text') {
continue;
}
txts[i].isfocus = false;
txts[i].onmouseover = function() {
this.style.backgroundColor = '#fffacd';
}
txts[i].onfocus = function() {
this.isfocus = true;
this.style.backgroundColor = '#fffacd';
this.style.borderColor = 'red';
}
txts[i].onmouseout = function() {
if(!this.isfocus) {
this.style.backgroundColor = '#ffffff';
}
}
txts[i].onblur = function() {
this.style.backgroundColor = '#ffffff';
this.style.borderColor = '#c0c0c0';
this.isfocus = false;
}
}
}window.onload = function() {
chanageBackColor('input');
chanageBackColor('textarea');
}
</script><style type="text/css">
form table {
font-size: 10pt;
}
form table td.top {
vertical-align: top;
}
form table td.td-r {
text-align: right;
}
input.txt {
width: 300px;
border: 1px solid #c0c0c0;
padding: 2px 2px;
}
textarea {
font-size: 10pt;
height: 100px;
width: 300px;
border: 1px solid #c0c0c0;
overflow-y: auto;
padding: 2px;
}
</style><body>
<form name="frm" method="post" action="#" onsubmit="return checkMobile();">
<table>
<tr>
<td class="td-r">姓名:</td>
<td><input type="text" name="name" class="txt"></td>
</tr>
<tr>
<td class="td-r">主页:</td>
<td><input type="text" name="page" class="txt"></td>
</tr>
<tr>
<td class="td-r">验证码:</td>
<td><input type="text" name="code" class="txt"></td>
</tr>
<tr>
<td class="td-r top">内容:</td>
<td><textarea name="comment"></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="确定"></td>
</tr>
</table>
</form>
</body>
</html>
<!--
input {
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 1px;
border-left-width: 0px;
border-top-style: dashed;
border-right-style: dashed;
border-bottom-style: dashed;
border-left-style: dashed;
border-top-color: #000000;
border-right-color: #000000;
border-bottom-color: #000000;
border-left-color: #000000;
}
-->
</style>
<input type="text" name="textfield" id="textfield" />
这个是我刚写的一个
在下边有条线
如果你不想要这条线的话 你可以把border-bottom-width: 1px;改成border-bottom-width: 0px;就可以了