472,986 Members | 2,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

Unable to center div

ok First time here and this is no doubt something really obvious I am overlooking. I use the following css and html to try and center a container div on a page. For the life of me it will not center in FF though. Any ideas??

Expand|Select|Wrap|Line Numbers
  1. html, body 
  2. {
  3.         margin: 0 auto;
  4.         padding: 0;
  5.     text-align: center;
  6.     font: xx-small Verdana, Geneva, Arial, Helvetica, sans-serif;
  7.     background-color:#cccccc;
  8.     height: 100%;
  9.         margin-bottom: 1px;
  11. #container{
  12.     width: 768px;
  13.     text-align: left;
  14.     margin-left: auto;
  15.     margin-right: auto;    
  16.     background-color: #fff;        
  17. }
<!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">
<title>center page</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<div id="container" >
Oct 24 '07 #1
7 2482
7,435 Expert 4TB
#container is centered.
Oct 24 '07 #2
Weird, the plot thickens, on my IE it is centered but not on my FF
Oct 24 '07 #3
7,435 Expert 4TB
Clear your cache and refresh.
Oct 24 '07 #4
5,058 Expert 4TB

Just tried this. Worked on both IE7 and Firefox 2.
Oct 24 '07 #5
thanks everyone for checking. Was doing my head in as knew the code was right.
Oct 25 '07 #6
I have managed to come back to this after being distracted. Still experiencing this weird non centering in FF. On FF, although body margins are set to 0 auto and container margins all 0 it is pushing the page across to the right instead of centering it as in IE.

Any ideas?
Oct 25 '07 #7
7,435 Expert 4TB
I looked at it again in both FF and IE6 and IE7 and they all look identical.
Oct 25 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Arun Nair | last post by:
Hi, I have the following jsp page. I am able to view only a part of it(until the occurence of the first City text box). If i remove the first few fields from the page, I am able to see a few...
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
by: db2sysc | last post by:
All: This is becoming a big problem for us. Whenever we are using control center it asks for the userid/passwd and when we provide the admin userid/passwd we get a error "Administrative...
by: annoir | last post by:
I am trying to create a stored procedure using the DB2 Connect Development Center. I am able to create the project, connect to the remote database on the mainframe and create the stored procedure....
by: deepaks85 | last post by:
Dear Friends, I am trying to upload multiple files. But I can't find why it is not working fine. Here is the code......... numfile.php <form method="POST" action="fileupload.php"> <p...
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
Unable to get the private bytes memory limit for the W3WP process. The ASP.NET cache will be unable to limit its memory use, which may lead to a process restart. Error: 0x80070005 ...
by: pyro169 | last post by:
Hey I am making a tic tac toe game, im new to javascript, and when i make the game with 'buttons' and 'x' and 'o' it works perfectly, but i also made some pics and i can get the pics to show up, but...
by: yangtono | last post by:
Hi, I am creating a table to list some data. The table is using a sorting and highlight function that I found from the net. I can't attach image here, basically html will wrap the heading,...
by: vikas251074 | last post by:
I am using ASP In my company, all employees have to sent materials out of premises. Any employee who need to sent material out will use this web application. In the first page, an employee enters...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.