Having trouble with the css style of my asp:Button, looking to replicate the precise css of my a.button class

Struggling with applying styles to an asp:button? Despite reading multiple posts, I can't seem to make it work for my situation.

My css setup for href tags looks like this:

a.button { padding:6px;background:#4A6491;color:#FFF; border-radius: 10px 10px 10px 10px;margin:10px 2px;text-decoration:none;font-size:12px;text-transform:uppercase;font-weight:bold;border:2px solid transparent; }
a.button:hover { border:2px solid #fff; }

I have an asp:button already styled for login functionality. I want to apply the same style to it but can't seem to get it to work.

<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup"  />

Answer №1

Here are some suggestions to improve the look and feel of your buttons:

a.button, input[type=submit] { padding:10px;background:#2E5874;color:#FFF; border-radius: 10px;margin:15px 5px;text-decoration:none;font-size:14px;text-transform:uppercase;font-weight:bold;border:3px solid transparent; }
a.button:hover, input[type=submit]:hover { border:3px solid #fff; }    

To ensure consistency between links and buttons, consider adding the cursor:pointer; style to the initial definition as well.

a.button, input[type=submit] { cursor:pointer; .... }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

One CSS file linked, but only one is applied; the other is left unused

After including two CSS files, I am experiencing an issue where only one of them is being utilized. The other file does not seem to be included and the reason behind this remains unknown. My website has a standard header file that is present on all pages. ...

Ways to prevent body content from overlapping with footer content and appearing below

Currently, I am utilizing an autocomplete text box where the scroll bar exceeds based on dynamic values. However, if more values are displayed in the text box, the scroll bar automatically extends to exceed the footer of the page, resulting in two scroll b ...

What is the reason for not being able to align breadcrumb text to the right

This section contains HTML code and CSS for a breadcrumb container. The issue is that the breadcrumb is currently displayed on the left side. How can the breadcrumb be right-aligned? .breadcrumb-container { font-family: "Work Sans", sans-serif; ...

Error encountered while attempting to concatenate strings in ASP.NET codebehind

I've been struggling with a small bug for a few hours now and I can't seem to figure it out. Here's the code snippet: using System; public partial class Controls_DashboardGraph : InboundOutboundControl { public string GraphTitle { ...

How can we have a div stay at the top of the screen when scrolling down, but return to its original position when scrolling back up?

By utilizing this code, a div with position: absolute (top: 46px) on a page will become fixed to the top of the page (top: 0px) once the user scrolls to a certain point (the distance from the div to the top of the page). $(window).scroll(function (e) { ...

How to align an image in the middle using Bootstrap and React

Having an issue with Bootstrap and aligning an image in the center. Currently, the image is appearing left-aligned: Here is the HTML: <div className="App vh-100"> <div className="d-flex h-70 border border-white container"> <div class ...

Executing Click and Clientclick events with Bootstrap Modal - A guide

Here's the Markup I'm Using : Note: Currently, I am utilizing the Metronic pre-built template that comes with all necessary components. <link href="vendors.bundle.css" rel="stylesheet" type="text/css"> <link href="style.bundle. ...

Scheduling tasks in ASP.NET web applications

I'm currently working on a web application using C# ASP.NET MVC. Every day, I need to update a value in the database and send an email at a specific time (which can be changed through the administration interface). What would be the most effective a ...

What could be the reason why this LESS CSS is not taking effect?

Why won't this stylesheet load properly? The desired background color is supposed to be similar to cadetblue. You can view my page with the linked home.less.css at: ...

The size of text enclosed within div elements appears distorted

Having difficulty adjusting text size within div tags, specifically when trying to set it in pixels. For example, setting font-size to 20px while maintaining a div size of 250 by 50 pixels results in stretched out text. Here's the code snippet: .NavB ...

Steps for updating placeholder text when a user makes a selection

My asp form group currently has two option values - one for country and the other for state/province. Is there a way to switch the text depending on the selection? For instance, when Canada is selected, the placeholder text will be Province, but when U.S ...

Is there a CSS Grid that supports IE6+ with percentage-based layouts?

Seeking a sleek CSS grid system that is percentage-based with 12 columns and works well on IE6+ as well as all modern browsers. Support for nested columns would be a bonus but not mandatory. Many grids out there lack compatibility with IE6 or are based sol ...

Learn how to achieve a sleek animation similar to the famous "Ken Burns effect" by utilizing the CSS property "transform" instead of "object-position". Check out the demo to see it in action!

I am currently exploring how to create an animation similar to the "Ken Burns" effect using CSS transform properties. While I have been using object-position to animate, I am facing challenges with the fluidity of the movement. I am seeking help to achiev ...

Issue with Bootstrap container's max-width not functioning

After implementing the code in the following manner: <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> <style type="text/css"> .con ...

How to programmatically recompile the Global.asax file in a simple way

Welcome to my custom CMS where I dynamically add routes from the database. Check out a sample code snippet below: foreach(DataTable table in ds.Tables) { foreach(DataRow dr in table.Rows) { ctr = ctr + 1; routes.MapPageRoute("Route" + ctr, rout ...

Issue with borders not displaying on cards in Bootstrap 3.4.0

In the 3.4.0 version of Bootstrap, I am facing an issue where cards are not showing borders. I am attempting to include multiple cards within a panel. I have tried using the "!important" property for the border, as well as using classes like "border-prima ...

What strategies can I use to make my div content more adaptable to different screen sizes and

Currently, in my project, I have implemented a layout using the top nav menu (purple part) and the left menu (pink part) as shown in the image. However, I am facing an issue where, upon deleting some content from the view, the pink menu on the left extends ...

The Challenges of Parsing HTML Source Code for Web Scraping

I've been attempting to scrape data from this website: (specifically rare earth material prices) using Python and BeautifulSoup. My query pertains not to Python, but rather the HTML source code of the site. When I utilize Firefox's "Inspect Elem ...

Modal window closed - back to the top of the page

I am struggling with a simple modal popup window that does not maintain the scroll position when closed, instead returning you to the top of the page. I am looking for a way to keep it at the same scroll position without much knowledge of Javascript. You ...

How can I implement a division animation with Javascript upon clicking a hyperlink?

I need help with animating a div when clicking on a link. Specifically, when clicking on the "About" link, the height of the div should change. Currently, the height is set to '0em' in the CSS file. I attempted to change the height using "documen ...