Hi, I'm having a problem with Firefox, I have a div to display the date in my website; in Opera and IE looks good but in Firefox it goes down like 10px, I don't know why is doing that. The only way I can fix it is if I put in the same div margin-top: -14px; but if I do that then it doesn't work in Opera or IE. Is there any type of hack for FF to fix this? Thanks in advance
We'd have to see the WHOLE code to determine what's going wrong - though given that opera and FF are usually on the same page, I'd be asking if you had validating code.... or maybe you have a javascript in there (FF3 is treating javascripts as block leven elements - messes up some people) I'd ballpark 99% of the time if there's a rendering difference in static content between Opera and FF, the difference is FF's incorrect handling of errors - meaning you probably are doing something wrong. Again though - wild guesses in the dark, no code, no joy. You're basically asking for us to do brain surgury over the telegraph in 1880.
Sorry about that I didn't posted the code because it's mixed with php. But here it is.. <tr><td width="100%"> <div style="margin-bottom: 10px;" class="border"><div class="maintitle">'; echo '<a href="?pg=article&id='.$id.' ">title</a><div class="date">[B]DATE[/B]</div></div> echo '<div class="mainbg"><div class="maincontent">news; <div class="mainfooter"><p><a href="admin?do=news&a=delete&t='.rawurlencode($title).'&id='.$id.'" class="delete" onclick="return confirm(\'Are you sure you want to delete '.$title.' news?\');">Delete</a><a href="admin?do=news&a=edit&t='.rawurlencode($title).'&id='.$id.'" class="delete">Edit -</a></p></div> </div> </div> </div> </td> </tr> </td> </tr> Code (markup): .date { float: right; color: #ccc; font-size: 10px; } Code (markup): I try to remove almost all the PHP, the problem is where it says DATE. Oh and yes the whole code is valid as a XHTML 1.0 Transitional.
Don't try to filter the PHP yourself; view source in the browser, and copy/paste. We need the whole thing, not just a snippet unless you've abstracted a minimal test case. A link will suffice. If Opera and IE act the same, and differ from FF, it's likely you're in quirks mode. Is your DTD complete, including the URI? In quirks, Opera emulates IE quirks. IE does not collapse margins properly where floats are concerned. See Layout and margin collapse. Read the whole article, but that section in particular. cheers, gary
What Gary said - but from what you showed so far: Single TD - so why are you using a table again? Inlined Style /FAIL/ at life. presentational class name - /FAIL/ Multiple DIV's, we'd need to see the CSS for every single one of those, though I'm betting NONE of those are needed. Div around a paragraph around content that isn't even a sentence fragment much less a paragraph - wow, bloat by thy name. You appear to be closing one more div than has been opened, though I have to say if this is typical of the output from your php, you need to throw it all away and start over.
Thank you guys for your replies but I already fix it myself. I just had to move the div date before the div title