469,636 Members | 1,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,636 developers. It's quick & easy.

How Do I Center This Sample Webpage In Firefox?

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>

Nov 19 '05 #1
4 6090
<div align="center">
<div align="center">
place stuff here
</div>
</div>

--
Daniel Fisher(lennybacon)
"Joey" <jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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>

Nov 19 '05 #2
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" <jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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>


Nov 19 '05 #3
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" <jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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>


Nov 19 '05 #4
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.

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Philipp Lenssen | last post: by
2 posts views Thread by doug s | last post: by
6 posts views Thread by Anton Vredegoor | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.