Struggling with CSS issues in ASP.NET 4.6

For the past few months, I've been diligently working on a project that suddenly hit a snag today. Upon inspecting my website, I noticed that all my button sizes appear to be uniform. I typically use Chrome's developer tools to troubleshoot my websites, but upon investigating, everything seemed normal. Can someone please assist me in identifying the issue and providing guidance on how to rectify it?

Below is the snippet of .aspx code:

<div class="row section text-center">
    <h2><%: Page.Title %> Page</h2><br />
    <asp:Button ID="stReturnButton" runat="server" CssClass="stButton-lg" Text="Back to Training Portal" PostBackUrl="~/SST/SafetyTrainingPortal.aspx" />
    <hr />
</div>

<div class="row col-xs-12 text-center">
    <div class="col-xs-6 text-center">
        <asp:Button ID="btnEditUpdate" runat="server" Text="Update Employee Certificates" CssClass="stButton-lg" PostBackUrl="~/SST/SUPERVISOR/UpdateCertificates.aspx"/>
    </div>
    <div class="col-xs-6 text-center">
        <asp:Button ID="btnAddCerts" runat="server" Text="Update Employee Profile" CssClass="stButton-lg" PostBackUrl="~/SST/SUPERVISOR/UpdateEmployeeProfile.aspx" />
    </div>

Here is the current appearance of the page: https://i.sstatic.net/nd4vK.png

This is the CSS styling for the buttons:

    .stButton {
    width: 190px;
    opacity: 1.0;
    color: #0e4676;
    background-color: #9FCF6E;
    border-color: #357ebd;
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 10px;
    box-shadow: #063156 3px 3px;
    cursor: pointer;
    user-select: none;
    text-align:center;
}
.stButton-lg {
    width: 325px !important;
    opacity: 1.0;
    color: #0e4676;
    background-color: #9FCF6E;
    border-color: #357ebd;
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 10px;
    box-shadow: #063156 3px 3px;
    cursor: pointer;
    user-select: none;
    text-align: center;
}

You can observe that there are styles defined for regular buttons as well as larger buttons in the provided CSS. The larger button styling is specifically targeted within the .aspx code. I have even used "!important" at the end of the width declaration, but unfortunately, the issue persists. I have also attempted inline styling without success. Additionally, I have checked the page on IE, Chrome, and Edge browsers.

Furthermore, here are the links featured in the Master Page along with an overview of the project folder structure: https://i.sstatic.net/Hnl1V.png I have disabled the Script.Render placeholder since I prefer declaring the links directly above it. Despite trying different configurations, the uncommented Script.Render did not provide a solution either.

I believe I've covered all aspects of the problem, but if I overlooked something crucial, kindly point it out, and I will include it promptly. Your assistance and insights are greatly appreciated.

Answer №1

I just wanted to express my gratitude for all the assistance. After some thorough investigating, I managed to uncover the solution which may prove beneficial to others. It turned out that a less seasoned team member had made a simple adjustment in the CSS file by setting the input controls width to Max-Width: 150px (not visible in the images provided). Such a small detail caused me to struggle for nearly an entire day, but I am relieved that it has been rectified.

A special thanks to everyone who contributed or left comments.

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

Restricting the number of lines within a paragraph in Angular 2

Is there a method to limit the number of lines in a <p> tag and add an ellipsis (...) at the end? Using character count for truncation doesn't work well as the width of the element varies according to device screen size. ...

In a two-column layout, ensure that the text in the left box is aligned to the left and the text in the right box is aligned to the

I'm working on a flexbox layout with two columns, each containing text. The text in the left column is aligned to the left, while the text in the right column is aligned to the right. However, I want the text in the right column to switch to left al ...

No adjustment in color upon switching themes

I've been struggling to achieve the desired outcome while working on a small coding task. The goal is to modify the color of the screen background, text, and button as illustrated in the uploaded image. I have three code files for this task - index, t ...

Struggling to place the sans-serif font right at the edge of the H1 tag

Encountering a strange issue that suggests I might be overlooking something simple. Any thoughts on the following: I have a heading tag styled with a sans-serif font (loaded from Google fonts) and when I apply a background-color, the text does not align t ...

Guide to selecting the initial index in search drop down with selenium using C#

IWebDriver driver = new ChromeDriver(); driver.Navigate().GoToUrl("http://www.yahoo.com"); driver.Manage().Window.Maximize(); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10)); driver.FindElement(By.XPath(" ...

Div's background image displays flawlessly on Code Pen desktop, yet fails to appear when viewed on mobile devices

I am currently experiencing an issue with my background images not rendering properly on mobile devices, specifically safari and chrome on iPhone XR. Although they appear to work perfectly on Code Pen - resizing properly as the viewport shrinks and switchi ...

Issue with fluid layout in CSS - Unable to specify height in pixels and minimum height property not functioning as expected

While working on a liquid layout, I have set all my width and height values in percentages. However, during the design process, I needed to check how my CSS was rendering so I temporarily set the height in pixels. Eventually, the height in percentage wil ...

What is the best way to layer four images in a 2x2 grid over another image using CSS as the background

I am attempting to place 4 images of the same size on a 5th image defined as the background. Currently, it looks like this: It works perfectly when the height is fixed, but in my case, the height may vary causing this issue: This problem isn't surp ...

The width of a div element seems to mimic the width of the entire page inexplic

There is a page containing various div elements. HTML: <div class="utilitiesHeader"> <div id="utilitiesLogo"></div> <div id="utilitiesFIO">Name of user</div> </div> <div class="utilitiesContent"> <d ...

Setting up Angular Toolkit via npm installation

After successfully installing the UIKit npm package within an Angular 2 CLI project, what steps should I take to utilize it? I have also installed typings for UIKit (@types/uikit), but I am unsure of how to properly import the package into a controller i ...

An issue with excess whitespace appearing below the footer while adjusting the size of the webpage

I have a database table on my website that I am styling with the help of bootstrap. Check out this screenshot for the issue: https://i.sstatic.net/CUkjz.jpg For the HTML code, you can view it here: And for the relevant CSS, click on this link: I used pa ...

Tips on disregarding events within an html table

I have a see-through table with a width set to 100% that houses various HTML content. I am utilizing the table to properly center a particular element on the screen. However, the table is intercepting mouse events and preventing users from clicking on lin ...

Button that floats on the left or right side within a div container

Is there a way to ensure that a button floats only within a specific div area? Below is the CSS and HTML example for reference. .test { width: 60%; display: inline; overflow: auto; white-space: nowrap; margin: 0px auto; } <div class=' ...

Updating text color in JavaFX for a textarea

I'm having trouble getting this to work. After checking the CSS analyzer in the scene builder, it seems that changing the text color in a textarea requires something like this: .text-area .text { -fx-fill: #1e88e5; -fx-font-size: 32px; } How ...

Is there a bug with the CSS Safari selector for elements focused together?

Looking for a solution using the element+element-Selector to modify CSS for an element following a button. This code snippet functions in Chrome, Edge, and Firefox but not Safari on MacOS: .button:focus+.change{ color: red; } <p>When you focus ...

How to display (fade in a portion of an image) using .SVG

I have the following code in my DOM: <div class="icon-animated"><img src="icon_non_active.svg" id="icon_non_active"></div> There are two icons (.svg) available: icon_non_active & icon_active Can I animate the transformation from i ...

Analyzing the string's worth against the user's input

I need help figuring out how to save user input on a form (email and password) as variables when they click "Register", so that the data can be used later if they choose to click "Login" without using default information. I am working on this project for s ...

React createElement function does not include string children when there are multiple children present within the inner HTML

Currently, I am utilizing React.createElement(...) to dynamically produce a basic react website using data from a JSON file. The JSON file consists of an array of JSON objects that represent elements and their respective children. An individual element&ap ...

Unleash the potential of a never-ending expansion for grid cells on Canvas

ts: templateStyle = { display: 'grid', 'grid-template-columns': 'calc(25%-10px) calc(25%-10px) calc(25%-10px) calc(25%-10px)', 'grid-template-rows': '150px auto auto', 'grid-gap ...

Creating an overlay effect when hovering over an image

Recently, I've been working on a gallery of photos that showcases different individuals. My goal is to have information about each person displayed when their respective photo is hovered over - including their name and role. .gallery { position: ...