Home » Microsoft TechnologiesRSS

SP 2007 - Master.page layout

I have been searching for a solution to a clients request. 

I need master page with:

1. 100% width header (center aligned)  

2. 960px width main content area (center aligned)

3. 100% width footer (center aligned)

 

Can I add a <div> around the main content  like so:

<div id="wrapper">CONTENT</div>

 #wrapper
{

 margin:auto;
 width: 960px;

} 


 

 

3 Answers Found

 

Answer 1

Hi!


Here you go.


<%@ master  Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!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">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <center>
    <div id="header" style="width:100%;"></div>
    <div id="Content" style="width:960px;text-align:left;">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    <div id="footer" style="width:100%;"></div>
    </center>
    </form>
</body>
</html>


or

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!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">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <style type="text/css">
        #Header{width:100%;}
        #Content{width:960px;text-align:left;}
        #footer{width:100%;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <center>
    <div id="header"></div>
    <div id="Content">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    <div id="footer"></div>
    </center>
    </form>
</body>
</html>


or you can use CSS file but i'm sure you know how to do that, right? :)

 

Answer 2

Great thank you for your help.

 

In the header and footer sections I should be able to add all the standard sharepoint controls, correct? 

 

Answer 3

caddyj:
In the header and footer sections I should be able to add all the standard sharepoint controls, correct? 

I don't see any reason why you couldn't do that.


P.S.: It would be nice of you to return the favour and mark post's that helped you as Aswered ;)

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Tech Videos   |   Follow us on Twitter