473,795 Members | 3,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make Firefox Center Content in a div Or td Tag By Using CSS?

Make Firefox Center Content in a div Or td Tag By Using CSS?

Does anyone know how to do this. IE works great with text-align:center;
but Firefox just always left-aligns...

Aug 5 '05 #1
2 11411
Els
jo*********@top scene.com wrote:
Make Firefox Center Content in a div Or td Tag By Using CSS?

Does anyone know how to do this. IE works great with text-align:center;
but Firefox just always left-aligns...


If you'd use a valid doctype, IE6 wouldn't do it either.
text-align:center only works on inline content.

To center block-level elements, you need to set the left and right
margin to identical values.

For instance:
<div class="outer">
<div class="inner">
some content
</div>
</div>

To center div.inner inside div.outer, you can use:
div.inner{width :[some value];margin:auto;}
or
div.inner{width :auto;margin:[some value];}

(Note: width:auto; is superfluous on a div, unless you've set a width
on divs earlier in the stylesheet, which you need to 'undo' by setting
it to the default 'auto'.)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: D.A.D. - Bad Craziness
Aug 5 '05 #2
jo*********@top scene.com wrote:
Make Firefox Center Content in a div Or td Tag By Using CSS?
http://dorward.me.uk/www/centre/
Does anyone know how to do this. IE works great with text-align:center;


Since the spec says that it shouldn't act in that way, its hardly "great".

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Aug 5 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6288
by: Joey | last post by:
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...
6
4904
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
9
7037
by: Dave | last post by:
Hi, I've been trawling the web for answer to my problem with no luck although I'm hardly alone it seems! Below is the generated source for an ASP page that posts a value called 'album' to another ASP page. The other page retrieves the value with Request.Form('album'); On Firefox this works fine every time. On IE6, I always get nothing. I'm pretty sure it's the posting side that is at fault, so that's what I've shown here. Oh, I tried...
3
5618
by: autospanker | last post by:
Ladies and Gentleman, I have been having this problem that has been driving me insane. I have a website that when viewed in Firefox first, the content in the body area is pushed down. Then when you click refresh, the content on that page is fine. I believe this could possibily a firefox issue. When I load the website in IE6 or IE7 the content is just fine. Any page you visit with IEXporer displays correctly where as if you go to the start...
4
1839
by: kumuda v | last post by:
Hi, I am new to web development. I have designed a main page using html and css, I am working in linux OS so I am using firefox. But the problem is with IE, where the entire contents and images is re-positioned . the page looks entirely different. Please anyone can help me in this regard. Here is the css and html code home.php <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="healthy dining...
2
2028
by: crumsoft | last post by:
hello every one i have face some problem related to css. my css file work good in firefox but not looking so good and work properly in internet explorer 6.0 plz help me and solve this problem. html file is. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1
3337
by: Jahamos | last post by:
Background: I have copy and pasted an Excel flowchart into a Dreamweaver html page. I created a frame on the top of the page as a viewer. I created hotspot links over the flowchart items. Each hotspot link should open a new anchor link in the top frame which references a different webpage. Problem: It works fine in Firefox. When clicking on the hotspots I get the appropriate html page anchor link to reference my html page and it correctly...
3
2029
by: Steve | last post by:
Hi All I have an asp.net 2.0 website with the following css file It uses Master pages and in Firefox 3.04 for windows only, 3 of the web pages don't display the Master page properly The content page overlaps the Master page boundaries In IE 6/7 All works fine
1
3813
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown properties alt in img tag istead of picture . place of the pictures is saved in the database(my database is with mysql) and in home page i fetch properties of the product and address of place that pictures is located output of the code in the...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.