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

wangjinchang 2010-07-09 07:55:31
问题是:我把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和火狐下都是没有问题的!
请高手帮忙解决下 。谢谢
分有点少,请见谅。
...全文
63 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
liiifeiii 2010-07-10
  • 打赏
  • 举报
回复
想切换,用别的方式可以实现吧
wangjinchang 2010-07-09
  • 打赏
  • 举报
回复
单独写CSS问件然后调用,是没有问题的!
只要写到主题文件中然后通过Theme="Default"来调用 就有问题。
因为我将来要切换页面的皮肤。所以写到这里了。
请高手帮忙看看!
wuyq11 2010-07-09
  • 打赏
  • 举报
回复
<link rel="stylesheet" href="css.css" type="text/css"/>
通过文件是否一样

62,050

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧