【问题标题】:Hide border in HTML Form or Input在 HTML 表单或输入中隐藏边框
【发布时间】:2012-09-03 23:53:11
【问题描述】:

有人知道如何在 HTML 中使用 Form 或 Input 标签隐藏边框吗?

我的代码如下:

<form name="timerform">
    Your session will expired in
    <input type="text" name="clock" size="7" value="5:00">
</form>

【问题讨论】:

    标签: html forms input


    【解决方案1】:

    你也可以使用

    input[type="text"] { border: none }
    

    当您有其他输入类型时,这很有用,即type="submit",但 IE

    检查this with typethis without type

    更新:也可以如下使用

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

    Updated Demo.

    【讨论】:

    • 你能教我如何设置那个css吗?是这样的&lt;style type="text/css"&gt;input { border: none; }&lt;/style&gt;
    • &lt;div align="center" class="input"&gt; &lt;font size="-2" face="verdana" color="#264F8A"&gt; &lt;form name="timerform"&gt; Your session will expired in &lt;input type="text" name="clock" size="7" value="5:00"&gt; &lt;/form&gt; &lt;/font&gt; &lt;/span&gt; &lt;/div&gt;
    • 是的,这对我有用,非常感谢,但是您知道如何使该框不可见,因为我的背景页面为灰色,当前框为白色。
    • 这个,&lt;input type="text" name="clock" size="7" value="5:00"&gt;原来的盒子是白色的,所以我的背景页面是灰色的,所以如何使盒子透明。
    • 如果你想要焦点时的边框,请删除outline:none
    【解决方案2】:

    在 CSS 中设置样式。 CSS 可以内嵌在网页的 HEAD 部分...

    <head>
        <style type="text/css">
          input { border: none }
          /* other style definitions go here */
    
        </style>
    </head>
    <body>
      <!-- your HTML code below... -->
    

    或者在你的情况下可能是最简单的:

    <form name="timerform">
        Your session will expired in
        <input type="text" name="clock" size="7" value="5:00" style="border:none" />
    </form>
    

    取决于你想用这个页面做多少。延伸阅读:http://www.w3schools.com/css/css_howto.asp

    【讨论】:

      猜你喜欢
      • 2015-05-28
      • 2015-01-03
      • 1970-01-01
      • 2018-04-07
      • 1970-01-01
      • 2013-08-01
      • 1970-01-01
      • 2012-01-24
      • 1970-01-01
      相关资源
      最近更新 更多