1

I am using the following HTML and CSS design for my web app - https://codepen.io/andytran/pen/PwoQgO

I needed to replace the button tag <button>Login</button> with the following,

<asp:Button ID="bnLogin" runat="server" Text="Login" OnClick="bnLogin_Click"  />

The problem is that I lose the CSS style when I use the asp:Button element instead of the button element.

Here is the corresponding HTML -

<div class="form">
    <h2>Login to your account</h2>
    <form id="form1" runat="server">
        <asp:TextBox ID="txtUserID" runat="server" Columns="50"  placeholder="User ID" ></asp:TextBox>
        <asp:TextBox ID="txtUserPassword" runat="server" Columns="50" TextMode="Password" placeholder="Password"></asp:TextBox>
        <asp:Button ID="bnLogin" runat="server" Text="Login" OnClick="bnLogin_Click"  />
        <br />
        <asp:Label ID="lblMsg" ForeColor="red" runat="server" />
    </form>
</div>

And the corresponding CSS -

.form-module button {
  cursor: pointer;
  background: #33b5e5;
  width: 100%;
  border: 0;
  padding: 10px 15px;
  color: #ffffff;
  -webkit-transition: 0.3s ease;
  transition: 0.3s ease;
}
.form-module button:hover {
  background: #178ab4;
}
0

2 Answers 2

2

I think it will hep your issue.

.form-module input[type="submit"]{
  cursor: pointer;
  background: #33b5e5;
  width: 100%;
  border: 0;
  padding: 10px 15px;
  color: #ffffff;
  -webkit-transition: 0.3s ease;
  transition: 0.3s ease;
}
.form-module input[type="submit"]:Hover {
  background: #178ab4;
}
Sign up to request clarification or add additional context in comments.

1 Comment

I'm glad to hear that :)
0

Use the code below in your css

.form-module input[type="submit"]:Hover {
background: #178ab4;
}

instead of

.form-module button:hover {
  background: #178ab4;
}

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.