在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:37:35  来源:igfitidea点击:

Hide border in HTML Form or Input

htmlformsinput

提问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.

使用 typethis 不使用 type 进行检查。

Update:Also you can use as follows

更新:您也可以使用如下

<input style="border:none" type="text" name="clock" size="7" value="5:00">

Updated Demo.

更新演示

回答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