日期:2014-05-19  浏览次数:20533 次

各位高手帮帮忙,关于在asp.net中引用了master,div定位的问题?在线等.
就是在写页面时我用到了master(就是页面的抬头和结尾部分),之后每个页面都要引用这个母板,而之后写的每个页面的内容都多少不一,还要使每个页面的抬头和结尾始终保持在浏览器的上下两侧,而这个master用div+css我该怎么定位呢??


------解决方案--------------------
http://www2.flash8.net/teach/3977.htm
------解决方案--------------------
在CSS样式中定义一个#head和一个#foot的DIV,然后对里面的相定义。给你一个example

<%@ Master Language= "C# " AutoEventWireup= "true " CodeFile= "MainPage.master.cs " Inherits= "MainPage " %>

<!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=utf-8 " />
<link href= "css/MaterPage.css " rel= "stylesheet " type= "text/css " />
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<div id= "top "> </div>
<div id= "menu ">
<ul>
<asp:Literal ID= "ltlCom " runat= "server " Text= "公司概况 "> </asp:Literal>  |
<asp:Literal ID= "ltlComNews " runat= "server " Text= "公司新闻 "> </asp:Literal>  |
<asp:Literal ID= "ltlTrade " runat= "server " Text= "行业动态 "> </asp:Literal>  |
<asp:Literal ID= "ltlProduct " runat= "server " Text= "产品展示 "> </asp:Literal>  |
<asp:Literal ID= "ltlNewPro " runat= "server " Text= "新品介绍 "> </asp:Literal>  |
<asp:Literal ID= "ltlOrder " runat= "server " Text= "在线订购 "> </asp:Literal>  |
<asp:Literal ID= "ltlJob " runat= "server " Text= "招聘英才 "> </asp:Literal>  |
<asp:Literal ID= "ltlFeedBack " runat= "server " Text= "客户反馈 "> </asp:Literal>  |
<asp:Literal ID= "ltlContact " runat= "server " Text= "联系我们 "> </asp:Literal>  |
<asp:Literal ID= "ltlBbs " runat=server Text= "交流论坛 "> </asp:Literal>  |
<asp:Literal ID= "ltlEnglish " runat= "server " Text= "English "> </asp:Literal>
</ul>
</div>
<div id= "contentplaceholder ">
<asp:contentplaceholder id= "ContentPlaceHolder1 " runat= "server " >
</asp:contentplaceholder>
</div>
<div id= "Copyright "> CopyRight 2007-2008 All Rights Reserved. DezaiStudio www.dezai.cn </div>
</div>
</form>
</body>
</html>