Home > Web Front-end > HTML Tutorial > How to remove the border and modify the background color of the input input box_html/css_WEB-ITnose

How to remove the border and modify the background color of the input input box_html/css_WEB-ITnose

不言
Release: 2018-05-18 17:20:16
Original
10992 people have browsed it

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

Because the editing and preview interfaces share the same interface, consider using styles to distinguish them. The above code should have the following results:

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

Can you please implement it

Reply to the discussion (solution)

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

It can be achieved with css
Define a class, and then define the border none and the background color
Wouldn’t it be better

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

1

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

After reading the question, are you asking how to achieve the JS effect?

<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>
Copy after login

No borders are border:0px; background-color: #fef;




source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template