我的css文件有问题。我正在使用asp.net中的visual studio编程,我想要设计我的页面登录。但有时,它有效,有时,它没有......
感谢您的帮助;)
这是我的代码CSS:
@charset "utf-8";
/* CSS Document */
@import url(http://meyerweb.com/eric/tools/css/reset/reset.css);
/* ---------- FONTAWESOME ---------- */
/*[class*="fontawesome-"]:before
{
font-family: Calibri, Candara, Segoe, "Segoe UI" , Optima, Arial, sans-serif;
}*/
/* ---------- GENERAL ---------- */
body
{
background-color: #C0C0C0;
color: #000;
font-family: Calibri, Candara, Segoe, "Segoe UI" , Optima, Arial, sans-serif;
font-size: 16px;
line-height: 1.5em;
}
.input
{
border: none;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
line-height: inherit;
-webkit-appearance: none;
}
/* ---------- LOGIN ---------- */
#login
{
margin: 50px auto;
width: 400px;
}
#login h2
{
background-color: #f95252;
-webkit-border-radius: 20px 20px 0 0;
-moz-border-radius: 20px 20px 0 0;
border-radius: 20px 20px 0 0;
color: #fff;
font-size: 28px;
padding: 20px 26px;
}
#login h2 span[class*="fontawesome-"]
{
margin-right: 14px;
}
#login fieldset
{
background-color: #fff;
-webkit-border-radius: 0 0 20px 20px;
-moz-border-radius: 0 0 20px 20px;
border-radius: 0 0 20px 20px;
padding: 20px 26px;
}
#login fieldset p
{
color: #777;
margin-bottom: 14px;
}
#login fieldset p:last-child
{
margin-bottom: 0;
}
#login fieldset input
{
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#UserEmail
{
background-color: #eee;
color: #777;
padding: 4px 10px;
width: 328px;
}
#login fieldset input[type="email"], #login fieldset input[type="password"]
{
background-color: #eee;
color: #777;
padding: 4px 10px;
width: 328px;
}
#login fieldset input[type="submit"]
{
background-color: #33cc77;
color: #fff;
display: block;
margin: 0 auto;
padding: 4px 0;
width: 100px;
}
#login fieldset input[type="submit"]:hover
{
background-color: #28ad63;
}
这是我的aspx页面:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Logon.aspx.cs" Inherits="projetDGCS1.Logon" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Connexion | DGCS</title>
<link href="css/styleLogin.css" rel="Stylesheet" />
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
</head>
<body>
<center>
<form id="form1" runat="server">
<div id="login">
<h2>
Connexion</h2>
<fieldset>
<p>
<label for="email">
Nom</label></p>
<p>
<asp:TextBox ID="UserEmail" runat="server" CssClass="input" /></p>
<p>
<label for="password">
Mot de passe</label></p>
<p>
<asp:TextBox ID="UserPass" TextMode="Password" runat="server" CssClass="input" /></p>
<p>
<asp:Button ID="Submit1" OnClick="Logon_Click" Text="Se connecter" runat="server" /></p>
<p>
<asp:Label ID="Msg" ForeColor="red" runat="server" />
</p>
</fieldset>
</div>
</form>
</center>
</body>
</html>
答案 0 :(得分:0)
对我来说效果很好。我能看到的唯一错误就是&#39; for&#39;标签上的属性应与表单元素的id属性匹配。
所以Nom标签应该是:<label for="UserEmail">
此登录是否与表单身份验证相关联?您可能需要在web.config文件中添加位置路径:
<configuration>
<location path="css/styleLogin.css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>