在 HTML 表单或输入中隐藏边框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12255198/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hide border in HTML Form or Input
提问by mastersuse
anybody knows how to hide border in HTML using Form or Input tag?
有人知道如何使用 Form 或 Input 标签在 HTML 中隐藏边框吗?
My Code as below:
我的代码如下:
<form name="timerform">
Your session will expired in
<input type="text" name="clock" size="7" value="5:00">
</form>
回答by The Alpha
You can also use
你也可以使用
input[type="text"] { border: none }
This is usefull when you have other input types, i.e. type="submit"
, but IE < 8 doesn't support type.
当您有其他输入类型,即type="submit"
,但 IE < 8 不支持类型时,这很有用。
Check this with typeand this without type.
Update:Also you can use as follows
更新:您也可以使用如下
<input style="border:none" type="text" name="clock" size="7" value="5:00">
更新演示。
回答by jtheman
Set the style in CSS. CSS can be applied inline in the HEAD section of the web page...
在 CSS 中设置样式。CSS 可以在网页的 HEAD 部分内嵌应用...
<head>
<style type="text/css">
input { border: none }
/* other style definitions go here */
</style>
</head>
<body>
<!-- your HTML code below... -->
or in your case might be easiest just:
或者在您的情况下可能是最简单的:
<form name="timerform">
Your session will expired in
<input type="text" name="clock" size="7" value="5:00" style="border:none" />
</form>
depending how much you want to do with this page. Further reading: http://www.w3schools.com/css/css_howto.asp
取决于你想对这个页面做多少。进一步阅读:http: //www.w3schools.com/css/css_howto.asp