Footer in masterpage gets bigger if the page doesn't have documenttype

Last post 11-19-2007 2:57 AM by Rinze. 8 replies.

Sort Posts:

  • Footer in masterpage gets bigger if the page doesn't have documenttype

    11-14-2007, 1:59 PM
    • Loading...
    • James25
    • Joined on 07-30-2007, 1:54 AM
    • Posts 1,017
    Hi! I have a page that is a masterpage and If have this:

    <!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" >

     in the masterpage the footer get real big. If I delete this:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> i get a nice footer on the page. Is there a way to make it work without deleting the documenttype? Thanks for any help!

  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-15-2007, 12:00 PM
    • Loading...
    • Rinze
    • Joined on 08-15-2007, 10:56 AM
    • Leiden, Netherlands
    • Posts 277

    it completely depends on the xhtml and css U are using. There is no way to tell.

    Without the doctype, the browsers will render in quircksmode, which is unpredictable. I strongly recommend leaving the doctype as is, and trying to validate your page to find the error.

     

    Hope this helps,

    rinze 

    Hope this helps !
    Rinze

    ---------
    please select 'mark as answer' if this post helped you!
  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-15-2007, 1:27 PM
    • Loading...
    • James25
    • Joined on 07-30-2007, 1:54 AM
    • Posts 1,017

    Hi! Thank you for the reply. I don't get any errors. I am using tables in master  page for the design, but if the content area is small the footer gets larger, if the content area is larger then the footer goes back further down to the bottom which we want. I am getting desperate on this cos like you said we want to keep doctype.

  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-15-2007, 1:42 PM
    • Loading...
    • James25
    • Joined on 07-30-2007, 1:54 AM
    • Posts 1,017

    This is the skeleton of my masterpage, if you create a page from this you will see the footer taking up half the page:

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

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title> This is the title</title>

    <link id="Link1" href="~/styles.css" type="text/css" runat="server" rel="stylesheet" />

     

    </head>

    <body>

    <form runat="server" id="formMain" style="height: 100%">

    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td valign="top"><table width="100%" height="102" border="0" cellpadding="0" cellspacing="0" background="<%= ResolveClientUrl("~/images/top_02.gif") %>">

    <tr>

    <td valign="top"><table id="Table2" width="980" height="102" border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td rowspan="2"> <img runat="server" src="~/images/top_01.gif" width="532" height="102" alt=""></td>

    <td rowspan="2"> <img runat="server" src="~/images/top_02.gif" width="13" height="102" alt=""></td>

    <td rowspan="2"> <img runat="server" src="~/images/top_03.gif" width="7" height="102" alt=""></td>

    <td colspan="8"> <img runat="server" src="~/images/top_04.gif" width="428" height="77" alt=""></td>

    </tr>

    <tr>

    <td> <a href="~/Default.aspx" runat="server"></a></td>

    <td> <img runat="server" src="~/images/top_06.gif" width="2" height="25" alt=""></td>

    <td> <a id="A1" href="~/FindBusiness.aspx" runat="server"></a></td>

    <td> <img runat="server" src="~/images/top_08.gif" width="2" height="25" alt=""></td>

     

    <td> </td>

     

    <td> <img runat="server" src="~/images/top_10.gif" width="2" height="25" alt=""></td>

    <td> <a id="A3" href="~/ContactUs.aspx" runat="server"></a></td>

    <td> <img runat="server" src="~/images/top_12.gif" width="10" height="25" alt=""></td>

    </tr>

    </table></td>

    </tr>

    </table>

    <table width="971" height="100%" border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td valign="top" background="<%= ResolveClientUrl("~/images/left_02.jpg")%>" style="width: 176px">

    <img runat="server" src="~/images/left_01.jpg" width="176" height="43" alt="">

    <table width="176" border="0" align="center" cellpadding="0" cellspacing="0">

    <tr>

    <td style="height: 19px;"><div align="left">

    &nbsp;&nbsp;&nbsp; &nbsp;</div></td>

    </tr>

    <tr>

    <td>

    &nbsp;&nbsp;

    </td>

    </tr>

    <tr>

    <td>

    &nbsp;&nbsp;&nbsp;<br />

    &nbsp;&nbsp;

    </td>

    </tr>

     

    <tr>

    <td ><div align="left">

    &nbsp; &nbsp;

     

    &nbsp; &nbsp;&nbsp;

    </div></td>

    </tr>

     

    <tr>

    <td ><div align="left">

    &nbsp;

    </div></td>

    </tr>

    </table>

    </td>

    <td style="width: 15px" bgcolor="white"></td>

    <td valign="top" style="width: 780px;" align="right">

    <br /> &nbsp;&nbsp;

    <br>

    <div align="left">

     

    <asp:contentplaceholder id="BodyContent" runat="server">

    </asp:contentplaceholder>

    </div>

    </td>

    </tr>

    </table></td>

    </tr>

    <tr>

    <td height="25"><table width="100%" height="18" border="0" cellpadding="0" cellspacing="0" background="<%= ResolveClientUrl("~/images/bot.gif")%>">

    <tr>

    <td style="height: 19px">&nbsp;</td>

    </tr>

    </table>

    <table width="980" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td width="200" style="height: 19px"><div align="center">

    &nbsp;</div></td>

    <td style="height: 19px"><div align="center">

    &nbsp;</div></td>

    <td width="200" style="height: 19px"></td>

    </tr>

    </table></td>

    </tr>

    </table>

    </form> </body>

    </html>

  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-15-2007, 3:11 PM
    • Loading...
    • docluv
    • Joined on 06-29-2002, 11:16 PM
    • Willow Spring NC
    • Posts 1,491
    • ASPInsiders
      TrustedFriends-MVPs

    You know I just found a MAJOR issue with using the DOCTYPE tag this week. A very simple layout that was actually generated by ImageReady's slicing rendered perfect in IE. Then I checked it out in FireFox and was blow away with how bad this looked. It was awful I banged around for hours trying to figure out what the issue was with the Mozilla engine. I finally hit the last of my patience and thought, hmmmm, it is worth a shot. I removed the DOCTYPE tag and voila everything was fine. So the moral to my story, remove the DOCTYPE tag from your page, FIREFOX sucks!

  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-15-2007, 4:46 PM
    • Loading...
    • samito19
    • Joined on 11-13-2007, 9:33 PM
    • Chicago
    • Posts 12

     I would check your css.  You can always attempt to throw in table tags when you declare the font size for your page.

    body, table {
    font-family:xxx;
    font-size: xpt;
    font-weight: normal;
    font-style: normal;
    }

    You can go back and assign a specific style to other tables/grids if you want to give them a different appearance.

  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-15-2007, 6:38 PM
    • Loading...
    • James25
    • Joined on 07-30-2007, 1:54 AM
    • Posts 1,017

    Thank you for the reply! That's what I did before and took care of footer,but then I wanted to use an Ajax control and it was broken because I didn't have doctype on there.

  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-19-2007, 2:46 AM
    • Loading...
    • Rinze
    • Joined on 08-15-2007, 10:56 AM
    • Leiden, Netherlands
    • Posts 277

    I do not wish to be unkind, but this isn't very good piece of advice ;-)

    ALWAYS include a doctype, preferably the strict dtd, but transitional will do. I would also suggest developing your layout in FireFox and add IE browser specific adjustments in seperate browser files. FireFox adheres to the standards, where the IE behaviour is very unpredictable. Many of the problems have been fixed in IE7, but ie6 is still widely used.

    Kind regards,

    rinze

    Hope this helps !
    Rinze

    ---------
    please select 'mark as answer' if this post helped you!
  • Re: Footer in masterpage gets bigger if the page doesn't have documenttype

    11-19-2007, 2:57 AM
    Answer
    • Loading...
    • Rinze
    • Joined on 08-15-2007, 10:56 AM
    • Leiden, Netherlands
    • Posts 277

    Creating a cross browser compatible layout that stretches over the full height of the page isn't a as easy as it sounds. The reason is that the height property simply isn't part of the standards.

    You can try giving the footer a certain height [height="25px"] and try giving the body height="auto" or height="100%". Always add quotation marks to your attributes and define the measure you are using (%, px, em etc.). When using a doctype, you should follow the definition of the doctype. You can use the w3c validator: (http://validator.w3c.org) to test your pages and get you on your way.

    As a sidenote: I would also advive against using tables for layout purposes, try using div & css instead.  

    Hope this helps,

    rinze

    Hope this helps !
    Rinze

    ---------
    please select 'mark as answer' if this post helped you!
Page 1 of 1 (9 items)
Microsoft Communities