【问题标题】:Is it possible to use CSS media queries for hiding input boxes but showing their values when printing?是否可以使用 CSS 媒体查询来隐藏输入框但在打印时显示它们的值?
【发布时间】:2011-08-14 01:38:21
【问题描述】:

是否可以使用 CSS 媒体查询来隐藏输入框但在打印时显示其值?

<input type="text" value="Print this value but not the input box."/>

【问题讨论】:

    标签: html css media-queries


    【解决方案1】:

    尝试为输入框设置透明背景和边框:

    @media print {
        input[type="text"] {
            display: inline;
            color: #000;
            background: transparent;
            border: 0;
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-10
      • 2012-08-01
      • 2013-05-29
      • 1970-01-01
      • 1970-01-01
      • 2013-10-23
      相关资源
      最近更新 更多