How Do I Center This Sample Webpage In Firefox?

Discussion in 'ASP .Net' started by Joey, Aug 12, 2005.

  1. Joey

    Joey Guest

    Does anyone know how to center this sample webpage in Firefox? If so,
    will you provide the example as it applies to this sample webpage? I
    have read numerous posts and articles on how to center content with
    CSS...none are working for me. The best I can do at this point is the
    "text-align: center" for my div tag, but that only works in IE. I want
    to be able to center all the content within the div (effectively center
    the site content) for both IE and Firefox...

    ---
    <%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
    %>
    <%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
    <%@ Page language="c#" Codebehind="Default.aspx.cs"
    AutoEventWireup="false" Inherits="T.Default" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>T Home</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    <LINK href="/Base.css" type="text/css" rel="stylesheet">
    </HEAD>
    <body>
    <form id="Form1" method="post" runat="server">
    <div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
    <table class="Main">
    <tr>
    <td align="center">
    <T:Banner id="BannerHeader" runat="server"></T:Banner>
    </td>
    </tr>
    <tr>
    <td align="center">
    <T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
    </td>
    </tr>
    <tr>
    <td align="left">
    <asp:literal id="litMain" runat="server" Text=" "></asp:literal>
    </td>
    </tr>
    <tr>
    <td align="center">
    <T:Banner id="BannerFooter" runat="server"></T:Banner>
    </td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </HTML>
    Joey, Aug 12, 2005
    #1
    1. Advertising

  2. <div align="center">
    <div align="center">
    place stuff here
    </div>
    </div>

    --
    Daniel Fisher(lennybacon)


    "Joey" <> wrote in message
    news:...
    > Does anyone know how to center this sample webpage in Firefox? If so,
    > will you provide the example as it applies to this sample webpage? I
    > have read numerous posts and articles on how to center content with
    > CSS...none are working for me. The best I can do at this point is the
    > "text-align: center" for my div tag, but that only works in IE. I want
    > to be able to center all the content within the div (effectively center
    > the site content) for both IE and Firefox...
    >
    > ---
    > <%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
    > %>
    > <%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
    > <%@ Page language="c#" Codebehind="Default.aspx.cs"
    > AutoEventWireup="false" Inherits="T.Default" %>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    > <HTML>
    > <HEAD>
    > <title>T Home</title>
    > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > <meta content="C#" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > name="vs_targetSchema">
    > <LINK href="/Base.css" type="text/css" rel="stylesheet">
    > </HEAD>
    > <body>
    > <form id="Form1" method="post" runat="server">
    > <div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
    > <table class="Main">
    > <tr>
    > <td align="center">
    > <T:Banner id="BannerHeader" runat="server"></T:Banner>
    > </td>
    > </tr>
    > <tr>
    > <td align="center">
    > <T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
    > </td>
    > </tr>
    > <tr>
    > <td align="left">
    > <asp:literal id="litMain" runat="server" Text=" "></asp:literal>
    > </td>
    > </tr>
    > <tr>
    > <td align="center">
    > <T:Banner id="BannerFooter" runat="server"></T:Banner>
    > </td>
    > </tr>
    > </table>
    > </div>
    > </form>
    > </body>
    > </HTML>
    >
    Daniel Fisher\(lennybacon\), Aug 12, 2005
    #2
    1. Advertising

  3. Joey

    Arty Guest

    I have noticed that Mozilla based browsers tend to disregard inline
    CSS. So, therefore, try something like
    <head><style>.MyClassStyle{color:#ff0000;}</style></head><body><div
    class="MyClassStyle">This text should be red.</div></body></html>

    Hope this helps more.


    Daniel Fisher(lennybacon) wrote:
    > <div align="center">
    > <div align="center">
    > place stuff here
    > </div>
    > </div>
    >
    > --
    > Daniel Fisher(lennybacon)
    >
    >
    > "Joey" <> wrote in message
    > news:...
    > > Does anyone know how to center this sample webpage in Firefox? If so,
    > > will you provide the example as it applies to this sample webpage? I
    > > have read numerous posts and articles on how to center content with
    > > CSS...none are working for me. The best I can do at this point is the
    > > "text-align: center" for my div tag, but that only works in IE. I want
    > > to be able to center all the content within the div (effectively center
    > > the site content) for both IE and Firefox...
    > >
    > > ---
    > > <%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
    > > %>
    > > <%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
    > > <%@ Page language="c#" Codebehind="Default.aspx.cs"
    > > AutoEventWireup="false" Inherits="T.Default" %>
    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    > > <HTML>
    > > <HEAD>
    > > <title>T Home</title>
    > > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > > <meta content="C#" name="CODE_LANGUAGE">
    > > <meta content="JavaScript" name="vs_defaultClientScript">
    > > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > > name="vs_targetSchema">
    > > <LINK href="/Base.css" type="text/css" rel="stylesheet">
    > > </HEAD>
    > > <body>
    > > <form id="Form1" method="post" runat="server">
    > > <div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
    > > <table class="Main">
    > > <tr>
    > > <td align="center">
    > > <T:Banner id="BannerHeader" runat="server"></T:Banner>
    > > </td>
    > > </tr>
    > > <tr>
    > > <td align="center">
    > > <T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
    > > </td>
    > > </tr>
    > > <tr>
    > > <td align="left">
    > > <asp:literal id="litMain" runat="server" Text=" "></asp:literal>
    > > </td>
    > > </tr>
    > > <tr>
    > > <td align="center">
    > > <T:Banner id="BannerFooter" runat="server"></T:Banner>
    > > </td>
    > > </tr>
    > > </table>
    > > </div>
    > > </form>
    > > </body>
    > > </HTML>
    > >
    Arty, Aug 12, 2005
    #3
  4. Joey

    Joey Guest

    Daniel, while that solution works, it does not work in a CSS
    stylesheet. What syntax is needed for that? I am sorry I was not more
    clear in my original answer.

    Specifically, I am looking for some CSS code that will center my site
    content in Firefox.

    Daniel Fisher(lennybacon) wrote:
    > <div align="center">
    > <div align="center">
    > place stuff here
    > </div>
    > </div>
    >
    > --
    > Daniel Fisher(lennybacon)
    >
    >
    > "Joey" <> wrote in message
    > news:...
    > > Does anyone know how to center this sample webpage in Firefox? If so,
    > > will you provide the example as it applies to this sample webpage? I
    > > have read numerous posts and articles on how to center content with
    > > CSS...none are working for me. The best I can do at this point is the
    > > "text-align: center" for my div tag, but that only works in IE. I want
    > > to be able to center all the content within the div (effectively center
    > > the site content) for both IE and Firefox...
    > >
    > > ---
    > > <%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
    > > %>
    > > <%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
    > > <%@ Page language="c#" Codebehind="Default.aspx.cs"
    > > AutoEventWireup="false" Inherits="T.Default" %>
    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    > > <HTML>
    > > <HEAD>
    > > <title>T Home</title>
    > > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > > <meta content="C#" name="CODE_LANGUAGE">
    > > <meta content="JavaScript" name="vs_defaultClientScript">
    > > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > > name="vs_targetSchema">
    > > <LINK href="/Base.css" type="text/css" rel="stylesheet">
    > > </HEAD>
    > > <body>
    > > <form id="Form1" method="post" runat="server">
    > > <div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
    > > <table class="Main">
    > > <tr>
    > > <td align="center">
    > > <T:Banner id="BannerHeader" runat="server"></T:Banner>
    > > </td>
    > > </tr>
    > > <tr>
    > > <td align="center">
    > > <T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
    > > </td>
    > > </tr>
    > > <tr>
    > > <td align="left">
    > > <asp:literal id="litMain" runat="server" Text=" "></asp:literal>
    > > </td>
    > > </tr>
    > > <tr>
    > > <td align="center">
    > > <T:Banner id="BannerFooter" runat="server"></T:Banner>
    > > </td>
    > > </tr>
    > > </table>
    > > </div>
    > > </form>
    > > </body>
    > > </HTML>
    > >
    Joey, Aug 12, 2005
    #4
  5. Joey

    Joey Guest

    Arty,

    I have no problems in implementing CSS with or without classes as
    inline, imbedded, or linked. In fact, I am making extensive use of it
    in my websites!

    The problem is specifically: I have not been able to code any CSS class
    that will center my site content in Firefox. I have read article after
    article about #global, margin: auto, etc. Each "solution" seems
    different, and none of them work for me. That is why I posted sample
    code in my original post.

    It is my opinion that this is WAY TOO COMPLICATED. For goodness sakes,
    all I want to do is center some content! I could do that in HTML 1.0
    with the old "depricated" 'center' tag!

    Anyways, thanks for trying to help me.
    Joey, Aug 12, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ChChanges
    Replies:
    2
    Views:
    826
    Mitja
    Jun 16, 2004
  2. rf
    Replies:
    0
    Views:
    433
  3. rf
    Replies:
    0
    Views:
    416
  4. 123Jim
    Replies:
    1
    Views:
    437
    dorayme
    Aug 17, 2010
  5. dorayme
    Replies:
    0
    Views:
    445
    dorayme
    Aug 17, 2010
Loading...

Share This Page