关于ASPX页面调CSS的问题,请告诉帮忙

wangjinchang wangjinchang 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
问题是:我把CSS直接写到页面上,再IE。火狐下打开页面都是没问题的。但是我把ASPX页面上的CSS写到主题里面即:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Main_Login" Theme="Default"%>

这样的话,再火狐里面就出问题了。但在IE写实没问题的。但是我直接把CSS写到页面上如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Main_Login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=ConfigurationManager.AppSettings["Title"]%></title>
<style type="text/css">
#loginbody {
background-color: #EFF1FC;
background-image: url(images/login_01.gif);
background-repeat: repeat-x;
background-position: top;
}
#logindiv {
width: 744px;
margin-top: 88px;
margin-right: auto;
margin-left: auto;
background-color: #FFFFFF;
border: 1px solid #C8CEDA;
}
#loginimg {
background-image: url(images/login_04.gif);
background-repeat: no-repeat;
height: 380px;
width: 720px;
margin-top: 12px;
margin-right: auto;
margin-left: auto;
}
#loginform {
margin-top: 30px;
margin-right: auto;
margin-bottom: 30px;
margin-left: auto;
font-size: 14px;
width: 614px;
}
.loginformip{
font-size: 14px;
line-height: 24px;
border: 1px solid #999999;
height: 24px;
margin-right: 20px;
padding-left: 4px;
}
.loginformbutton{
height: 28px;
width: 60px;
font-size: 14px;
}
#loginc {
clear: both;
margin-right: auto;
margin-left: auto;
background-image: url(images/login_08.gif);
background-repeat: no-repeat;
height: 38px;
width: 603px;
margin-top: 20px;
}
</style>

</head>
<body id="loginbody">
<form id="form1" defaultfocus="" runat="server">
<div id="logindiv">
<div id="loginimg"></div>
<div id="loginform">
登录ID:
<asp:TextBox ID="txtLoginName" runat="server" class="loginformip"></asp:TextBox>
密码:
<asp:TextBox ID="txtLoginPassword" runat="server" TextMode="Password" class="loginformip"></asp:TextBox>
<asp:Button ID="btnLogin" runat="server" Text="登录" class="loginformbutton" onclick="btnLogin_Click" OnClientClick="javascript:return login()"/>
</div>
</div>
<div id="loginc"></div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
function login() {
var name = document.getElementById("txtLoginName").value;
var password = document.getElementById("txtLoginPassword").value;
if (name == "" || name == null) {
alert("请输入登录ID!");
return false;
}
else
if (password == "" || password == null) {
alert("请输入密码!");
return false;
}
}
</script>
这样的话 再IE和火狐下都是没有问题的!
请高手帮忙解决下 。谢谢
分有点少,请见谅。
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
wangjinchang
.NET社区 62,275 成员 668,968 内容