Re: Master Pages: Why is all of my content centered?



Ok, I finally found what was causing all of these problems.

At the !DocType directive, I saw this in addition to what I originally
had: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";

Apparently, this is a newer definition of XHTML and totally screwed up
my pages when rendered in IE. I only found out about it because some
labels I had CSS on weren't using height and width. Found out with
the new definition, that width and Height no longer work in SPANs. I
hope Microsoft eventually changes the renders of labels to DIVs
instead of SPANs, or else this will break how some people want to use
a label.

Anyways, everything is back to normal in my application.

Jason

On Jan 26, 4:36 pm, "TheLongshot" <TheLongs...@xxxxxxxxx> wrote:
Well, if I do, it is hiding from me. I didn't change any of the
markup, yet on every single page, the content is centered.

The body of my master page:

<body bgcolor="#ececec" leftmargin="0" topmargin="0"
onbeforeunload="javascript: if (bDirty && !IgnoreDirty) return 'You
have not saved your changes.';">
<form id="form1" runat="server">
<uc1:header id="Header1"
runat="server"></uc1:header><uc1:navigation id="Navigation1"
runat="server"></uc1:navigation>
<table width="95%" height="550" border="0" align="center"
cellpadding="0" cellspacing="1" ID="Table8">
<tr>
<td valign = "top">
<asp:contentplaceholder id="cpMain" runat="server" >
</asp:contentplaceholder>
</td>
</tr>
</table>
<uc1:footer id="Footer1" runat="server"></uc1:footer>
</form>
</body>

Just as a note, I did try removing everything from inside the body tag
except for the contentplaceholder and got the same result. There is
nothing in the css file that dictates style for the body tag (or any
tag for that matter).

Part of the default.aspx page:

<%@ Register TagPrefix="uc1" TagName="PageHistory"
Src="Controls/PageHistory.ascx" %>
<%@ Page language="c#" Inherits="T._default" CodeFile="default.aspx.cs"
MasterPageFile="TMaster.master" Title="T"%>
<asp:Content ID="Content1" runat="Server"
ContentPlaceHolderID="cpMain">
<table class="arrowBackground" id="Table11" height="550"
cellSpacing="0" cellPadding="0" Width="100%" bgColor="#ffffff"
border="0">
<tr>
<td width="20%" colSpan="3" style="height: 14px"></td>
</tr>
<tr>
<td vAlign="top" align="center" width="95%">
<asp:loginview runat="server"
id="LoginView1"><LoggedInTemplate>
<!-- BEGIN CONTENT AREA -->
<TABLE id="Table9" height=25
cellSpacing=0 cellPadding=0 width="75%" border=0
background="images/pageTitleTile25.gif">
<TBODY>
<TR>
<TD
align=left><uc1:pagehistory id="PageHistory" runat="server"
Initialize="True" Visible="True" Text="Main"></uc1:pagehistory> </TD>

Removing the "center" align from the td tag above just left alignes the
cell. The content is still centered. Even tho the TD tag for the
pagehistory control is left justified, the pagehistory control is
centered when rendered.

css for "arrowBackround"

.arrowBackground {
background-image: url(images/backgroundArrow.gif);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center bottom;

}I'm at a loss.

Jason

On Jan 26, 3:02 pm, senfo <enceladus...@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

TheLongshot wrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?Unfortunately, it's impossible to give you a detailed response without
seeing your code and/or markup. Your best bet is to look at the
rendered HTML or the CSS for your page(s). More than likely you have
something in there that you're not expecting.

At any rate, it's most likely not related to master pages, per se.

Hope that helps,

--
Sean

website:http://senfo.blogspot.com

.



Relevant Pages

  • Re: [PHP] Couple of beginner questions
    ... // somewhere in the business logic / functional layer ... The custom tag will expand the path to wherever the images directory was ... It's a pain in the ass overriding a CSS rule that was ... through all the other methods of doing it - however for a couple of years now I've limitted all presentation to css only, css contained in a stylesheet - I try to use minimal css classes, and stick to using an id wherever I can't simply redefine the html tag. ...
    (php.general)
  • Re: [PHP] Couple of beginner questions
    ... The custom tag will expand the path to wherever the images directory was ... It's a pain in the ass overriding a CSS rule that was ... wherever I can't simply redefine the html tag. ... infact ideally an html tag should never be seen in a php script ...
    (php.general)
  • Re: Absolute page width wanted
    ... Absolute Positioning is a pretty advanced topic. ... It is done using CSS ... Each tag has a specific set ... In addition, it can be used OUTSIDE of the HTML tag, ...
    (microsoft.public.frontpage.programming)
  • Re: HTML Formatting in .NET 2.0
    ... As to height, you can use the CSS height style, which can be one of 2 ... > a STYLE tag in the document vs. a STYLE attribute on the element? ... document style sheet: Styles may be used throughout the document. ... >> XHTML will eventually supercede HTML on the WWW. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Absolute page width wanted
    ... >Absolute Positioning is a pretty advanced topic. ... Each tag ... >done, prior to CSS. ... OUTSIDE of the HTML tag, ...
    (microsoft.public.frontpage.programming)