How to color the upload control [How to Set CSS for the control of fileupload]

Source: Internet
Author: User

Today I met a post where a foreigner asked me how to color the fileupload control. Even the MVP of a foreigner said it was not easy.

In fact, sometimes we only need to work around to solve such a small problem. Let's look at myCode.

<% @ Page Language = " C # "   %>

<!Doctype HTML public"-// W3C // dtd xhtml 1.0 transitional // en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<Script runat="Server">

</Script>

< HTML xmlns = " Http://www.w3.org/1999/xhtml " >
< Head runat = " Server " >
< Title > </ Title >
< Style Type = " Text/CSS " >
# Divfileupload Input
{
Border - Color: olive;
Border - Style: solid;
Border - Width: 1px;
}
</ Style >
</ Head >
< Body >
< Form ID = " Form1 " Runat = " Server " >
< Div ID = " Divfileupload " >
< ASP: fileupload ID = " Fileuploadcssdemo " Runat = " Server "   />
</ Div >
< ASP: button ID = " Btnsubmit " Runat = " Server " Text = " Submit "   />
</ Form >
</ Body >
</ Html >
Pay attention to the CSS part in the Code. In fact, the principle is very simple. We know that fileupload will be interpreted by the browser as an HTML element marked with input, so I will apply the style to the HTML element in divfileupload of this specific Div. So if you run my code, you will see that the style will only be applied to the fileupload control, it will not be applied to other HTML elements that can be interpreted as input.# Divfileupload Input
{
Border-color : Olive ;
Border-style : Solid ;
Border-Width : 1px ;
}

This is the source address for me to answer questions to foreigners:

Http://forums.asp.net/p/1423781/3176963.aspx#3176963

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.