Is it possible to use CSS media queries for hiding input boxes but showing their values when printing?

StackOverflow https://stackoverflow.com/questions/5808136

  •  24-10-2019
  •  | 
  •  

Pergunta

Is it possible to use CSS media queries for hiding input boxes but showing their values when printing?

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

Solução

Try giving the input boxes transparent backgrounds and borders:

@media print {
    input[type="text"] {
        display: inline;
        color: #000;
        background: transparent;
        border: 0;
    }
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top