伙计们,我有一个 css 文件“menu.css”,我在母版页的头部调用了它,但它似乎不起作用。
<link href="CSS/menu.css" rel="stylesheet" type="text/css" />
我尝试了很多替代方案,例如
<link id="Link1" href='<%= ResolveUrl("~/CSS/menu.css") %>' rel="stylesheet" media="screen" type="text/css"/>
但一切都无济于事。但是,当我通过消除 css 文件将 css 的内容粘贴到母版页头中时,它就可以工作了。我真的不明白错误是什么。一切似乎都很好,但并没有达到预期的效果。下面是我的母版页。任何帮助,将不胜感激。
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Debt.master.cs" Inherits="Debt.Debt" %>
<!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">
<link id="Link2" href='<%= ResolveUrl("~/CSS/menu.css") %>' rel="stylesheet" media="screen" type="text/css"/>
<title>Members Page</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
* { margin:0;
padding:0;
}
body { background:#555 url(images/back.jpg); }
#menu { top:30px; }
#copyright {
margin:100px auto;
width:80%;
font:12px 'Trebuchet MS';
color:#bbb;
text-indent:20px;
padding:40px 0 0 0;
}
#copyright a { color:#bbb; }
#copyright a:hover { color:#fff; }
.style1
{
}
.ModalBackground
{
background-color:Gray;
filter: alpha(opacity=60);
opacity: 0.6;
z-index: 10000;
}
.ModalPopup
{
background-color:White;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:5px;
width: 350px;
height:210px;
}
</style>
<link id="Link1" href='<%= ResolveUrl("~/CSS/menu.css") %>' rel="stylesheet" media="screen" type="text/css"/>
<link href="CSS/menu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/menu.js"></script>
</head>
<body runat="server">