Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Spacing on .net Page [ContentPlaceHolder]

Options
  • 14-09-2008 6:30pm
    #1
    Registered Users Posts: 527 ✭✭✭


    Hi all,

    Can anyone tell me how to create a Master Page with only one contentplaceholder that starts in the very top left of the page.

    So if you put an image in the top left of the page there will be no gaps on either side and you wont see the background colour.

    Here's some of the code I have tried so far:

    CSS:
    body
    {
    	width: 100%;
    	widows: 0;
    	background-color: Black;
    	padding: 0;
    	color:White;
    }
    



    MasterPage:
    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="sample.master.cs" Inherits="sample.sample" %>
    
    <!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>sample</title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
        <link href="mycss.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ContentPlaceHolder ID="MainContent" runat="server">
               THIS SHOULD BE IN THE TOP LEFT
            </asp:ContentPlaceHolder>
        </form>
    </body>
    </html>
    


    thanks in advance.


Comments

  • Registered Users Posts: 3,594 ✭✭✭forbairt


    you'll probably want to use a reset css script

    basically putting margin:0; padding:0; on most elements does the trick and you can semi ensure some level of cross browser compliance.

    edit: windows: 0; doesn't actually exist .. (or else I've definitely been missing something all these years) :D


  • Registered Users Posts: 527 ✭✭✭Sean^DCT4


    I was missing the margin :o:o:o

    Widows: 0 apparently is "The minimum number of lines of a paragraph to leave at the top of the page"

    thanks


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    Sean^DCT4 wrote: »
    I was missing the margin :o:o:o

    Widows: 0 apparently is "The minimum number of lines of a paragraph to leave at the top of the page"

    thanks

    No problem

    I probably don't know it because it pretty much doesn't work on any browsers (barring opera and probably ff3 and ie8)
    Internet Explorer for Windows versions up to and including 7 don’t support this property.

    Firefox versions up to and including 2 don’t support this property.

    Safari versions up to and including 3 don’t support this property.


Advertisement