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
  •  | 
  •  

문제

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."/>
도움이 되었습니까?

해결책

Try giving the input boxes transparent backgrounds and borders:

@media print {
    input[type="text"] {
        display: inline;
        color: #000;
        background: transparent;
        border: 0;
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top