简体   繁体   中英

Styling textbox of an HTML file input

I have an asp.net 2.0 web app where I use C#. I have an HTML file input control that I would like to style, but I can't seem to find a way to do it. I actually wanted to change the color of the textbox. I looked online but I couldn't find any proper solutions.

Can anyone help?

Thank you.

You could use CSS and redefine the elements or use a div tag.

  1. http://forums.devshed.com/css-help-116/how-to-define-css-styles-for-text-box-input-s-50111.html
  2. http://www.velocityreviews.com/forums/t118125-css-and-textbox.html
  3. You might use an ASP control and get access to properties that way. It has a class property you can define.

You can style the text color of the HTML file input like you can any other element. Works in FF and IE8:

#inputId { color: #ff0000; }

For more involved styling, you'll need to resort to workarounds, like this one .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM