0

I've just been dabbling with creating a web form in Visual Studio 2012.

The default appearance of a button when I drag it onto my form from the Tools pallet and run the form is just flat. Running the form, it doesn't change appearance based on being enabled or disabled. "Pushing" it shows no change in appearance. In other words, it isn't nearly as nice as a Windows Forms button created in the same way.

Do I have to write some CSS code or something to change this?

(My default browser for debug is Firefox.)

2
  • 1
    Yes, you will have to add some CSS to style the button the way you want it. Commented Mar 26, 2014 at 20:10
  • cssbuttongenerator.com - that was hard. Commented Mar 26, 2014 at 20:18

1 Answer 1

1

You can use CSS to customize a button. jsfiddle.net/8cqcF

enter image description here

<style type="text/css">
    .submit {
        border: 1px solid #563d7c;
        border-radius: 5px;
        color: white;
        padding: 5px 10px 5px 25px;
        background-image: url(https://cdn.sstatic.net/stackoverflow/img/sprites.png?v=6);
        background-position-y: 465px;
        background-position-x: 5px;
        background-color: #563d7c;
    }
</style>

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

Thesedays, a lot of people use front-end frameworks such as Bootstrap.

Here is the example of bootstrap buttons.

enter image description here

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

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.