【问题标题】:problem with internet explorer showing html input button which is hiddenInternet Explorer 显示隐藏的 html 输入按钮的问题
【发布时间】:2010-02-25 06:00:42
【问题描述】:

我有一个 vb.net 程序,它有一个网络浏览器控件,我们都知道它是在 Internet Explorer 之前使用计算机中的网络浏览器。我的问题是,它无法识别这个 css 代码:

<style type="text/css">
@media print {

    input[type=button] { display: none; }

}

当我打印网页时,我用它来使打印按钮不可见。 我该如何解决这个问题?是否可以添加对像 firefox 这样的便携式网络浏览器的引用,然后它将被 vb.net 中的网络浏览器控件使用?

【问题讨论】:

    标签: css vb.net


    【解决方案1】:

    IE [attribute=value] 选择器。你将不得不使用一个类。

    Quirksmode compatibility table

    【讨论】:

    • @user225 我编辑了它,它只适用于 IE <input type='button' class='type_button'> 并使该类不可见:input.type_button { display: none }
    【解决方案2】:

    您需要使用其他方法通过类名或 ID 隐藏元素;

    .hideme { display:none }
    

    您要向其中添加类名:

    <input type="button" name="authcode" value="Foo" class="hideme" />
    

    【讨论】:

      【解决方案3】:

      不确定让 VB.Net 使用不同的 Web 浏览器,但 IE 6 不理解 CSS 属性选择器(即[type=button])。

      如果您可以修改 HTML 以将类添加到 &lt;input&gt;(例如 &lt;input type="button" class="button"&gt;),那么您可以使用以下代码隐藏它:input.button { display: none; }

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-01-21
        • 1970-01-01
        • 2011-02-19
        • 1970-01-01
        • 2014-05-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多