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??

CSS
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;
  10.  
  11. #container{
  12.     width: 768px;
  13.     text-align: left;
  14.     margin-left: auto;
  15.     margin-right: auto;    
  16.     background-color: #fff;        
  17. }
  18.  
HTML[html]
<!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">
<head>
<title>center page</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="container" >
Here
</div>
</body>
</html>[/html]
Oct 24 '07 #1
7 2482
drhowarddrfine
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
drhowarddrfine
7,435 Expert 4TB
Clear your cache and refresh.
Oct 24 '07 #4
Atli
5,058 Expert 4TB
Hi.

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
drhowarddrfine
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

1
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...
2
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...
5
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...
3
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....
0
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...
6
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 ...
3
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...
2
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,...
18
vikas251074
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...
0
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=()=>{
2
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...
2
isladogs
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...
0
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...
0
tracyyun
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...
3
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...
0
NeoPa
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...
0
isladogs
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...
4
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.