0

So for example, I have a lovely button control:

<asp:Button ID="Button1" runat="server" Text="Button" />

Which when renders, is a lovely dull grey, nice and rectangular, etc, etc.

I know I can apply a new CSSClass to amend the CSS of said control, but where can I find the original CSS properties for this?

I appreciate this is a stupid question : )

4 Answers 4

3

This is the default style by the browser, not the ASP.NET control and you won't find a style you can edit for each user of the web. For instance, if you look at an ASP.NET button in Mozilla and IE they will look a little different.

If you want to style them, use CSS as you said.

Sign up to request clarification or add additional context in comments.

Comments

1

Not sure for all controls but for basic ones like buttons browsers usually have their own default definitions.

For Firefox, for instance, you can find a bunch of stylesheets files in its installation folder:

C:\Program Files\Mozilla Firefox\res

Comments

1

There isn't a css class in the sense of what your talking about. Each browser has its own "css" style for standard html controls (buttons,radio,text boxes). You can however make a css class to override any browser styling.

Comments

0

If it's a normal HTML button when rendered in the browser, you can use something like this in CSS:

#button1

{
 background-image:url(path-to-image/button1_sprite.png);
 background-repeat:no-repeat;
 background-position:left;
 background-color:#ffffff;
 border:none;
}

Then it will change the look of your <button> tag :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.