Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOt centering in FF - but does in IE...

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

Just wondering if anyone could help me =)

For some reason, this table center's fine in IE, but not FF :/

Code:
<div id="front_cat_table">
<h3>Find People...</h3>
<p>To start your search, please select a category from below, or use our search facility found above.</p>
<table class="front_cat_table">
	<tr>
		<td>
		<p align="center"><img src="[URL unfurl="true"]http://members.graphicsfactory.com/clip-art/image_files/image/7/793107-desk_1091.gif"[/URL] alt=" desk_1091 " border="0"></td>
		<td>
		<p align="center"><img src="[URL unfurl="true"]http://members.graphicsfactory.com/clip-art/image_files/tn_image/5/793855-tn_chat_923.gif"[/URL] alt="chat_923" title="chat_923" border="0" height="32" width="32"></td>
	</tr>
	<tr>
		<td>
		<p align="center">Businesses</td>
		<td>
		<p align="center">People</td>
	</tr>
</table>
</div>

Code:
.front_cat_table {
  padding: 2px 2px 2px 2px;
  margin-top: 5px;
  border-collapse: collapse;
  width: 75%;
  font-size: 11px;
  align: center;
}

.front_cat_table td {
  width: 50%;
}

#front_cat_table {
  align: center;
}

I've tried everything I can think of - including wrapping another <div id="front_cat_table"> around the content, to make that a center'ed <div> - but even that doesn't work :/

TIA for **any** ideas!

Andy
 
1. To centre a block level element (such as a div) in a modern browser, you should use css property margin. The way to do it is to specify the width of the element and then add automatic margins for left and right side ([tt]margin: 0 auto;[/tt]).

2. There is no align property in CSS. The closes one is text-align, but it is only used for inline objects.

3. If your example works in IE, then it is because of one of two things:
a) You do not have a doctype specified. That will cause you a lot of headaches when trying to make your page look and act the same across browsers.
b) You're using a very old version of IE. In that case I suggest you get a new version.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Hi,

Thanks everyone - managed to sort it now :):)

Cheers

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top