好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

input输入框如何去除边框和修改背景色_html/css_WEB-ITnose

<body> 
 <table> 
 <tr> 
 <td> 
 <input type="text" value="不如意十八九" > 
 </td> 
 </tr> 
 </table> 
 </body> 

因为编辑和预览界面共用一个,考虑使用样式进行区分,上面代码要以下的结果:

<body> 
 <table> 
 <tr> 
 <td> 
 不如意十八九 
 </td> 
 </tr> 
 </table> 
 </body> 

请问各位能否实现

回复讨论(解决方案)

<input type="text" value="不如意十八九" style="border:0px;"> 

用css就能实现 定义一个class,然后定义边框 none,背景色 不就好了

<input type="text" style="border:0px;background-color:blue" value="不如意十八九" >
<input type="text" style="border:0px;background-color:blue" value="不如意十八九" > 

+1

input{ border-style:none; background-color:#FF9;} 

看了下问题,是不是在问JS效果如何实现?

<body> 
 <table> 
 <tr> 
 <td id="box"> 
 <input type="text" value="不如意十八九" id="myinput" > 
 <button onclick="clicked()">click me</button> 
 </td> 
 </tr> 
 </table> 
 </body> 

------------------ 
<script>function clicked(){
var user_val = document.getElementById("myinput").value;document.getElementById("box").innerHTML = user_val;
}</script> 

没有边框都是border:0px;背景色background-color:#fef;

查看更多关于input输入框如何去除边框和修改背景色_html/css_WEB-ITnose的详细内容...

  阅读:40次