Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3342428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:50:15+00:00 2026-05-18T00:50:15+00:00

I have a standard button in my default.aspx page. <asp:Button ID=Search_Button runat=server Text=Search onclick=Search_Button_Click

  • 0

I have a standard button in my default.aspx page.

<asp:Button ID="Search_Button" runat="server" Text="Search" 
                      onclick="Search_Button_Click" />

and like this i have many buttons in my project. what i wish to do is make the button look fancy and i know it can be done in the CSS file, but i dont know how to do it.

i have this CSS code but it is in the anchor and i cant figure out how to implement that class with my asp:Button class.

a.button {
/* Sliding right image */
background: transparent url('button_right.png') no-repeat scroll top right; 
display: block;
 float: left;
     height: 32px; /* CHANGE THIS VALUE ACCORDING TO IMAGE HEIGHT */
 margin-right: 6px;
 padding-right: 20px; /* CHENGE THIS VALUE ACCORDING TO RIGHT IMAGE WIDTH */
 /* FONT PROPERTIES */
 text-decoration: none;
    color: #000000;
 font-family: Arial, Helvetica, sans-serif;
  font-size:12px;
  font-weight:bold;
   }
  a.button span {
  /* Background left image */ 
   background: transparent url('button_left.png') no-repeat; 
   display: block;
   line-height: 22px; /* CHANGE THIS VALUE ACCORDING TO BUTTONG HEIGHT */
    padding: 7px 0 5px 18px;
   } 
    a.button:hover span{
    text-decoration:underline;
         }

any help will be appreciated. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:50:15+00:00Added an answer on May 18, 2026 at 12:50 am

    The CSS that you posted will apply to anchor elements.
    Buttons in ASP.NET are not anchors, they are input elements.

    There are a few things you can do to get your styles on buttons.

    The simplest would be to change the CSS that you posted. Instead of applying it to <a> elements, apply it to <input type="submit"> instead. Do it this way :

    input[type="submit"] 
    {
        /* Sliding right image */
        background: transparent url('button_right.png') no-repeat scroll top right; 
        display: block;
        float: left;
        height: 32px; /* CHANGE THIS VALUE ACCORDING TO IMAGE HEIGHT */
        margin-right: 6px;
        padding-right: 20px; /* CHENGE THIS VALUE ACCORDING TO RIGHT IMAGE WIDTH */
        /* FONT PROPERTIES */
        text-decoration: none;
        color: #000000;
        font-family: Arial, Helvetica, sans-serif;
        font-size:12px;
        font-weight:bold;
     }
     input[type="submit"]:hover
     {
        text-decoration:underline;
     }
    

    This will apply the style to all buttons that are affected by your css. Note that you also have a style for a.button span which I’m not quite sure what you’re trying to do with. If you give more details on what you are trying to style we will be able to help you. I removed it here for now.

    If you want to go with something more specific — style that button only for example, you could do it as well. To do that, you would add a CSS class in your ASP markup that specifies the CSS class that you want to use :

    <asp:Button ID="Search_Button" runat="server" Text="Search" 
                          onclick="Search_Button_Click" CssClass="my-button" />
    

    Then, in your CSS, you would change the rule I posted above. Instead of input[type="submit"] you would go with :

    input[type="submit"].my-button
    {
        //...
    }
    

    Always try to go with rules as general as possible in your CSS. If all the buttons in your site will look like this one, then go with the first option, your CSS will be simpler that way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standard asp:login control: <asp:Login ID=mbLogin runat=server TitleText= DestinationPageUrl=~/Default.aspx PasswordRecoveryText=Forgot your password?
I've deconstructed a standard WPF button using Blend and have managed to create a
I have a standard windows server that inherits from the ServiceBase class. On the
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET
if i have a standard ASP.NET application, is there any difference between making an
I have a standard asp.net webform with multiple textboxes (Autopostback=False) on it and a
I have an ASP.NET web page with a Login control on it. When I
I'm trying to create standard button in android with a background and some text
I have a Microsoft keyboard with a series of non-standard buttons such as Mail,
Many languages have standard repositories where people donate useful libraries that they want others

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.