Trouble with CSS in ASP.NET 4.6

76 Views Asked by At

I have a project I've been working on for the past couple of months. Everything has been working fine up till today. When I came I noticed that all my button sizes were the same. I like to use the developer tools in Chrome to help debug my websites, and when I looked to see why the buttons weren't displaying properly; nothing seemed amiss. So will you please help me identify what is going on and how I should fix it?

Here is the .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 what the page looks like now: enter image description here

This is the CSS 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;
}

As you can see I have CSS for a normal button and CSS for a larger button. The larger button being what I'm targeting in my .aspx code. I include the "!important" at the end of the width because the buttons aren't displaying correctly; just to see if that would help... obviously it didn't. I've also tried inline styling and that doesn't work either. One important note, I've viewed the page in the following browsers: IE, Chrome, and Edge.

Anyway, here are the links in the Master Page with a view of the files in the folder structure of the project: enter image description here I commented out the placeholder for the Script.Render since I'm declaring the links directly above the placeholder. Also, having it uncommented did nothing for me as well.

I think I've covered it all, so if I've missed something please let me know and I'll include it. I appreciate all and any help that is given.

1

There are 1 best solutions below

0
On BEST ANSWER

Thank you for your help. I found the answer however and hopefully this helps someone else. The problem was that another less experienced team member had changed the width for the input controls to Max-Width: 150px in the CSS (not shown in the pictures above). That tiny thing through me for almost an entire day, but at least it was found and corrected.

Thank you to those who helped or commented.