473,699 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Absolute Positioning within Table Cell Alignment Problem in FireFox (Mozilla)

Hello,

I have just started messing with absolute positioning on webpages, and
it definitely let's you do some creative things. Well, after much
searching and help, I got the images I was using to overlap correctly.
You can see it on this page:

www.creativekaysjewelry.com

The images overlap exactly how I wanted and in the right position
within the table cell... The only problem is that it works on every
other browser except FireFox... What am I doing wrong? You can view all
the code by viewing the page source, but here it is anyways:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Creative Kays Jewelry</TITLE>
<LINK rel="stylesheet " href="styles.cs s" type="text/css">
<META http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<STYLE type="text/css">
..bordercolorim g{
border-width : 2px;
border-style : solid;
border-color : #CCCCCC;
}

td#container {
display: block;
position: absolute;
width: 560px;
height: 400px;
text-align: center;
}

#leftimg {
position: absolute;
top: 123px;
left: 0px;
}

#rightimg {
position: absolute;
top: 123px;
right: 0px;
}

#topimg {
position: absolute;
top: 0px;
left: 178px;
}

#bottomimg {
position: absolute;
bottom: 0px;
left: 178px;
}
</STYLE>
<script language="JavaS cript" type="text/JavaScript">
<!--
function MM_swapImgResto re() { //v3.0
var i,x,a=document. MM_sr;
for(i=0;a&&i<a. length&&(x=a[i])&&x.oSrc;i++ ) x.src=x.oSrc;
}

function MM_preloadImage s() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0;
i<a.length; i++)
if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
x=MM_findObj(n, d.layers[i].document);
if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_sw apImage.argumen ts; document.MM_sr= new Array;
for(i=0;i<(a.le ngth-2);i+=3)
if ((x=MM_findObj( a[i]))!=null){docum ent.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</HEAD>

<BODY>
<DIV align="center">
<TABLE width="780" border="0" cellspacing="0" cellpadding="0" >
<TR>
<TD width="170" valign="top">
<TABLE width="170" border="0" cellspacing="0" cellpadding="0" >
<TR>
<TD width="10" height="140">&n bsp;</TD>
<TD width="150" height="140" align="center"
background="ima ges/menubg_top.gif" >&nbsp;</TD>
<TD width="10" height="140">&n bsp;</TD>
</TR>
<TR>
<TD width="10" height="50">&nb sp;</TD>
<TD width="150" height="50" align="center"
background="ima ges/menubg_about.gi f"><A href="about.htm l"
onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Men u1','','images/menu_about_on.g if',1)"><IMG
src="images/menu_about.gif" name="Menu1" width="140" height="20"
border="0"></A></TD>
<TD width="10" height="50">&nb sp;</TD>
</TR>
<TR>
<TD width="10" height="50">&nb sp;</TD>
<TD width="150" height="50" align="center"
background="ima ges/menubg_neck.gif "><A href="necklaces .html"
onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Men u2','','images/menu_neck_on.gi f',1)"><IMG
src="images/menu_neck.gif" name="Menu2" width="75" height="20"
border="0"></A></TD>
<TD width="10" height="50">&nb sp;</TD>
</TR>
<TR>
<TD width="10" height="50">&nb sp;</TD>
<TD width="150" height="50" align="center"
background="ima ges/menubg_brace.gi f"><A href="bracelets .html"
onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Men u3','','images/menu_brace_on.g if',1)"><IMG
src="images/menu_brace.gif" name="Menu3" width="70" height="20"
border="0"></A></TD>
<TD width="10" height="50">&nb sp;</TD>
</TR>
<TR>
<TD width="10" height="50">&nb sp;</TD>
<TD width="150" height="50" align="center"
background="ima ges/menubg_ear.gif" ><A href="earrings. html"
onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Men u4','','images/menu_ear_on.gif ',1)"><IMG
src="images/menu_ear.gif" name="Menu4" width="65" height="20"
border="0"></A></TD>
<TD width="10" height="50">&nb sp;</TD>
</TR>
<TR>
<TD width="10" height="50">&nb sp;</TD>
<TD width="150" height="50" align="center"
background="ima ges/menubg_shows.gi f"><A href="upcomings hows.html"
onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Men u5','','images/menu_shows_on.g if',1)"><IMG
src="images/menu_shows.gif" name="Menu5" width="125" height="20"
border="0"></A></TD>
<TD width="10" height="50">&nb sp;</TD>
</TR>
<TR>
<TD width="10" height="50">&nb sp;</TD>
<TD width="150" height="50" align="center"
background="ima ges/menubg_gal.gif" ><A href="gallery.h tml"
onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Men u6','','images/menu_gal_on.gif ',1)"><IMG
src="images/menu_gal.gif" name="Menu6" width="60" height="20"
border="0"></A></TD>
<TD width="10" height="50">&nb sp;</TD>
</TR>
<TR>
<TD width="10" height="145">&n bsp;</TD>
<TD width="150" height="145" align="center"
background="ima ges/menubg_bot.gif" >&nbsp;</TD>
<TD width="10" height="145">&n bsp;</TD>
</TR>
<TR>
<TD colspan="3">&nb sp;</TD>
</TR>
</TABLE></TD>
<TD width="610" valign="top">
<TABLE width="610" border="0" cellspacing="0" cellpadding="0" >
<TR>
<TD colspan="3">&nb sp;</TD>
</TR>
<TR>
<TD width="20">&nbs p;</TD>
<TD width="570" align="left"><A href="index.htm l"><IMG
src="images/logo_75.jpg" width="346" height="110" border="0"></A></TD>
<TD width="20">&nbs p;</TD>
</TR>
<TR>
<TD height="30" colspan="3">&nb sp;</TD>
</TR>
</TABLE>
<!-- MAIN PAGE TABLE INFORMATION -->
<TABLE width="610" border="1" cellpadding="0" cellspacing="0"
background="ima ges/bubbles.gif">
<TR>
<TD width="20" height="400">&n bsp;</TD>
<TD width="560" height="400" align="center" id="container" >
<DIV id="topimg"><IM G src="images/home_top.jpg" width="200"
height="150" class="borderco lorimg"></DIV>
<DIV id="bottomimg"> <IMG src="images/home_bot.jpg" width="200"
height="150" class="borderco lorimg"></DIV>
<DIV id="leftimg"><I MG src="images/home_left.jpg" width="200"
height="150" class="borderco lorimg"></DIV>
<DIV id="rightimg">< IMG src="images/home_right.jpg" width="200"
height="150" class="borderco lorimg"></DIV></TD>
<TD width="30" height="400">&n bsp;</TD>
</TR>
<TR>
<TD colspan="3" height="40">&nb sp;</TD>
</TR>
<TR>
<TD colspan="3" align="center" class="copyrigh t"><A
href="index.htm l" class="cr">Home </A| <A href='#'
onClick="window .open('contact. html','Contact' ,'menubar=yes,s crollbars=yes,r esizable=yes,wi dth=300,height= 200');return
false;" class="cr">Cont act</A| <A href='#'
onClick="window .open('policy.h tml','Policy',' menubar=yes,scr ollbars=yes,res izable=yes,widt h=500,height=40 0');return
false;" class="cr">Poli cy</A| Copyright &copy; 2006 CREATIVEKAYS
JEWELRY. All Rights Reserved.</TD>
</TR>
</TABLE>
<!-- END MAIN PAGE TABLE INFORMATION -->
</TD>
</TR>
</TABLE>
</DIV>
</BODY>
</HTML>

Thanks for any help...

Nino Skilj

Nov 21 '06 #1
2 16412
ni********@yaho o.com wrote:
>
I have just started messing with absolute positioning on webpages,
"mess" is probably the right word, though not in the way you originally
intended. ;) Absolute positioning tends to make a mess of things if you
don't fully understand how it works and the consequences thereof.
www.creativekaysjewelry.com

The images overlap exactly how I wanted and in the right position
within the table cell...
This illustrates my point, I think.
The only problem is that it works on every
other browser except FireFox... What am I doing wrong?
The problem is not with Firefox, but your illogical usage of positioning
in the first place. It doesn't make sense to absolutely position a table
cell, does it?

If you are going to use positioning, please take the time to learn what
each method really does, and be prepared to deal with the consequences.
Get a good understanding of the box model while you are at it. IOW,
learn the technology you are attempting to use. If you're up to the
challenge, go read the specs at http://www.w3.org/TR/CSS21/visuren.html

That aside, a better way to get the results you want is to put all in
images into a relatively positioned container, then they can be
absolutely positioned within it. You don't need to put each image into a
div, either. Using your existing ids, it might be coded as

<td><div id="container" >
<img... id="leftimg">
....
</div></td>

#container would be position:relati ve, but otherwise pretty much what
you already have for style rules.

BTW, it would be wise to start abandoning table layouts to begin with.
That particular subject has been done ad nauseam in these groups, so
search the google archives for more info on that.
http://groups.google.com/advanced_search

--
Berg
Nov 21 '06 #2
Bergamot wrote:
"mess" is probably the right word, though not in the way you originally
intended. ;) Absolute positioning tends to make a mess of things if you
don't fully understand how it works and the consequences thereof.
Haha! I actually do get the concept of relative and absolute, but it
got confusing when trying to apply it within tags, and understanding
what relative and absolute truly meant within each realm...
The problem is not with Firefox, but your illogical usage of positioning
in the first place. It doesn't make sense to absolutely position a table
cell, does it?
Very true... that's where I was getting confused. It actually just took
you telling me this to realize how dumb that sounds... It's all making
sense now...
That aside, a better way to get the results you want is to put all in
images into a relatively positioned container, then they can be
absolutely positioned within it. You don't need to put each image into a
div, either. Using your existing ids, it might be coded as

<td><div id="container" >
<img... id="leftimg">
...
</div></td>

#container would be position:relati ve, but otherwise pretty much what
you already have for style rules.
It worked! I made the changes and "messed around" with some other
attributes as well. I really just needed to step away from the problem,
get a little help, and now it makes more sense. Thanks again for the
help Berg!

Nino

Dec 5 '06 #3

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

Similar topics

4
11015
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like to have it be that they would stay in the same relative position. I want to keep the image as an...
2
4295
by: Csaba2000 | last post by:
Demo page at http://csaba.org/Demos/getRect.htm One question I've seen come up multiple times is: How can I find the abolute position of my favorite element on the page? The standard answer is not working for me on any of IE/Netscape/Opera! The above page demonstrates the problem. I'd love to know how to make it work correctly. The usual answer, which I have been using, too, is something like: function getRect(elem) {
6
4867
by: Harald Kirsch | last post by:
In the W3C document about CSS2, I read at http://www.w3.org/TR/REC-CSS2/visuren.html#choose-position the following: absolute The box's position (and possibly size) is specified with the 'left', 'right', 'top', and 'bottom' properties. These properties
4
3140
by: Peter Pfannenschmid | last post by:
Hello experts, I would be very grateful if you would have a look at the following URL: http://www.omeganet.de/test.html The html file and the associated style have been validated successfully by the online validators of w3.org.
4
25830
by: wls | last post by:
I've got a problem that requires rendering DIVs at different offset locations, and while I've got a solution that works, the absolute positioning is working to the client window, not to the parent container. The stuff I write will get placed inside a table cell produce by someone else's template -- I have no control other than to emit HTML/CSS within that sole cell. So, I decided to construct a simple case and am having problems...
4
7426
by: Robert | last post by:
Hi, I am trying to add a background to a cell that contains multiple horizontal coloured layers on top of eachother. I managed to do this in IE, but firefox displays something very different so I would like to know if my HTML is in error or firefox. This is my HTML
2
3161
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is that I would like to display some text on top of an image within the header. I've tried using absolute positioning to specify where the phone number should appear in relation to the parent div (#header). However the text appears to be positioned in...
20
2811
by: mehstg1319 | last post by:
Hi there Not sure if anyone can help me, I am working on a site for my university, and am having a bit of trouble with css positioning. I am very new to css and do not know very much about it. Here is the link: http://homepages.feis.herts.ac.uk/~bp6ar/bus_intel/matrix/matrix.html Basically, the problem is that the ticks on the grid look perfectly
14
3310
by: Fistro | last post by:
I'm trying to find a design that would allow me to build web pages without having to worry about compatibility issues (not too much, in any case,,,) I've came across this CSS layout technique: http://alistapart.com/articles/fauxabsolutepositioning It calculates the left offset from a fixed position, as opposed to calculating it from the right edge of the preceding element by using a combination of position: relative, left: 100% and a...
1
8936
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
8894
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...
1
6544
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
5879
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
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2361
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2015
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.