I have an html select element which I would like to style for print so that it just looks like the selected text. How can I hide the drop down arrow?
问题:
回答1:
You can't.
There is nothing in the standards that specifies that the select element has to have an arrow to indicate to the user that it has options to choose from, or how those options are shown. As those visual elements are not defined, there is naturally nothing defined for changing them.
You just have to display a different element when printing.
回答2:
The below works for Firefox, Safari, Chrome and a few others
-moz-appearance: none; -webkit-appearance: none; appearance: none;
For IE support look at http://fetchak.com/ie-css3/
回答3:
In webkit you can specify:
-webkit-appearance: none;
Not sure about the other browsers.
回答4:
回答5:
One idea: for the print operation, swap the combo box with a label control.
回答6:
You could provide the selected text value next to the dropdown and hide it via CSS. Then use a print stylesheet to show the text and hide the dropdown when printing.