By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,229 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,229 IT Pros & Developers. It's quick & easy.

Super wierd FireFox problem/Bug ? Please help

P: 3
I'm constructing a website with a layout created with div-tags. They have a fixed width, float left, and display inline. When one of the div's contain a select-element the right-most div floats down for no apparent reason, but when the select-elements are gone they all align as expected. No css apply to the select-elements.
image of prob.: http://sdc.novasol.com/site/nov/TMP/withSelectBoxes.gif
image of expected: http://sdc.novasol.com/site/nov/TMP/noSelectBoxes.gif
Expand|Select|Wrap|Line Numbers
  1. <div id="mainArea">
  2.     <!-- left moduleArea -->
  3.     <div class="leftModuleArea sideModuleArea width190" style="background-color:#999999">
  4.         <!-- modules goes here -->
  5.         <div class="type01 module"> Her er et modul </div>
  6.         <div class="type01 module"> Her er et modul </div>
  7.         <!-- end - modules goes here -->
  8.     </div>
  9.     <!-- end - left moduleArea -->
  10.     <!-- contentArea -->
  11.     <div class="contentArea">
  12.         <div class="content width530" style="display:inline;">
  13.             <!-- module -->
  14.             <div class="module type10Module">
  15.                 <!-- module header area -->
  16.                 <div class="clickable headerArea" onClick="showHideLayers('contentID09','imgID09','buttonDown','buttonUp' )">
  17.                     <!-- ugly firefox fix -->
  18.                     <img src="images/transDot.gif" class="FF_Fix" />
  19.                     <!-- end - ugly firefox fix -->
  20.                     <div class="buttonDown" id="imgID09"></div>
  21.                     <h2>Lyns&oslash;gning</h2>
  22.                     <h3>V&aelig;lg land, antal, periode og klik s&oslash;g, for at finde ledige sommerhuse </h3>
  23.                 </div>
  24.                 <!-- end - module header area -->
  25.                 <!-- module content are -->
  26.                 <div class="moduleContentArea">
  27.                     <div class="moduleContentTop"><spacer width="1px" height="1px"></spacer></div>
  28.                     <div class="moduleContent" style="height:400px;">
  29.                         <!-- module content -->
  30.                         <!-- end - module content -->
  31.                         <form>
  32.                             <table width="100%" border="0" cellpadding="0" cellspacing="0">
  33.                                 <tr>
  34.                                     <td align="right">
  35.                                         <h4>Omr&aring;de</h4>
  36.                                     </td>
  37.                                     <td>
  38.                                         <select name="C" class="size100w" onChange="setAction(this.options[selectedIndex].value)">
  39.                                             <option value="xx" selected >V&aelig;lg</option>
  40.                                             <option value=208>Danmark</option>
  41.                                             <option value=578>Norge</option>
  42.                                             <option value=752>Sverige</option>
  43.  
  44.                                         </select>
  45.                                     </td>
  46.                                     <td rowspan="6">
  47.                                         <div class="browseMapArea mapXXXxXXX" style="width:200px; height:250px; background-color:#CCCCCC;"></div>
  48.                                     </td>
  49.                                 </tr>
  50.                                 <tr>
  51.                                     <td align="right">
  52.                                         <h4>Antal</h4>
  53.                                     </td>
  54.                                     <td>
  55.                                         <select name="PE" class="size100w" id="select">
  56.                                             <option value="yy" selected >V&aelig;lg</option>
  57.                                             <option value=1>1 Person</option>
  58.  
  59.                                         </select>
  60.                                     </td>
  61.                                 </tr>
  62.                                 <tr>
  63.                                     <td align="right">
  64.                                         <h4>Ankomst</h4>
  65.                                     </td>
  66.                                     <td>
  67.                                         <input type="text" class="size100w" name="SD" value="" onFocus="validateStartDate( this.form ); this.blur();return true;" onClick="makeLink('search','SD',document.search.C.options[document.search.C.options.selectedIndex].value)">
  68.                                         <a href="javascript:makeLink('search','SD',document.search.C.options[document.search.C.options.selectedIndex].value)"> <img src="http://sdc.novasol.com/pic/nov/images/transDot.gif" class="calendar" alt="V&aelig;lg dato"/></a><a href="javascript:makeLink('search','SD',document.search.C.options[document.search.C.options.selectedIndex].value)"></a></td>
  69.                                 </tr>
  70.                                 <tr>
  71.                                     <td align="right">
  72.                                         <h4>Afrejse</h4>
  73.                                     </td>
  74.                                     <td>
  75.                                         <input name="ED" value="" class="size100w" onFocus="this.blur(); return true;" onClick="makeLink('search','ED',document.search.C.options[document.search.C.options.selectedIndex].value)">
  76.                                         <a href="javascript:makeLink('search','ED',document.search.C.options[document.search.C.options.selectedIndex].value)"> <img src="http://sdc.novasol.com/pic/nov/images/transDot.gif" class="calendar" alt="V&aelig;lg dato"/> </a></td>
  77.                                 </tr>
  78.                                 <tr>
  79.                                     <td>&nbsp;</td>
  80.                                     <td align="right">
  81.                                         <div class="button type01_h30px" style="float:right;">
  82.                                             <div class="arrow">
  83.                                                 <div class="buttonL"></div>
  84.                                                 <div class="buttonMain"> <a href="#" onClick="doSubmit(document.search.name);"> S&oslash;g</a> </div>
  85.                                                 <div class="buttonR"></div>
  86.                                             </div>
  87.                                         </div>
  88.                                     </td>
  89.                                 </tr>
  90.                                 <tr>
  91.                                     <td>&nbsp;</td>
  92.                                     <td align="right">
  93.                                         <p id="moreSearchCriteria"><a href="#" class="lookLikeLink" onClick="javascript:doAdvSearch()"> Flere s&oslash;gekriterier</a> </p>
  94.                                     </td>
  95.                                 </tr>
  96.                             </table>
  97.                         </form>
  98.                     </div>
  99.                     <div class="moduleContentBottom"><spacer width="1px" height="1px"></spacer></div>
  100.                 </div>
  101.                 <!-- end - module content area -->
  102.                 <div class="moduleBottom"><spacer width="1px" height="1px"></spacer></div>
  103.             </div>
  104.             <!-- end - module -->
  105.         </div>
  106.     </div>
  107.     <!-- end - contentArea -->
  108.     <!-- right moduleArea -->
  109.     <div class="rightModuleArea sideModuleArea width190" style=" background-color:#3399FF;">
  110.         <!-- modules goes here -->
  111.         <div class="module type08Module">
  112.             <!-- module header area -->
  113.             <div class="headerArea" >
  114.                 <!-- ugly firefox fix -->
  115.                 <img src="images/transDot.gif" class="FF_Fix" />
  116.                 <!-- end - ugly firefox fix -->
  117.                 <div class="buttonDown" id="imgID02"></div>
  118.                 <h2>Newsletter</h2>
  119.                 <h3>- sign up now </h3>
  120.             </div>
  121.             <!-- end - module header area -->
  122.             <!-- module content are -->
  123.             <div class="moduleContentArea" id="contentID02">
  124.                 <div class="moduleContentTop"><spacer width="1px" height="1px"></spacer></div>
  125.                 <div class="moduleContent" >
  126.                     <!-- module content -->
  127.                     <p>great deals and good news straight to your inbox </p>
  128.                     <form name="form2" method="post" action="">
  129.                         <input name="textfield" type="text" class="size150w">
  130.                     </form>
  131.                     <div class="button type02_h24px">
  132.                         <div class="v">
  133.                             <div class="buttonL"></div>
  134.                             <div class="buttonMain"><a href="#">knap text</a></div>
  135.                             <div class="buttonR"></div>
  136.                         </div>
  137.                     </div>
  138.                     <!-- end - module content -->
  139.                 </div>
  140.                 <div class="moduleContentBottom"><spacer width="1px" height="1px"></spacer></div>
  141.             </div>
  142.             <!-- end - module content area -->
  143.             <div class="moduleBottom"><spacer width="1px" height="1px"></spacer></div>
  144.         </div>
  145.         <div class="module type08Module">
  146.             <!-- module header area -->
  147.             <div class="headerArea" >
  148.                 <!-- ugly firefox fix -->
  149.                 <img src="images/transDot.gif" class="FF_Fix" />
  150.                 <!-- end - ugly firefox fix -->
  151.                 <div class="buttonDown" id="imgID02"></div>
  152.                 <h2>Newsletter</h2>
  153.                 <h3>- sign up now </h3>
  154.             </div>
  155.             <!-- end - module header area -->
  156.             <!-- module content are -->
  157.             <div class="moduleContentArea" id="contentID02">
  158.                 <div class="moduleContentTop"><spacer width="1px" height="1px"></spacer></div>
  159.                 <div class="moduleContent" >
  160.                     <!-- module content -->
  161.                     <p>great deals and good news straight to your inbox </p>
  162.                     <form name="form2" method="post" action="">
  163.                         <input name="textfield" type="text" class="size150w">
  164.                     </form>
  165.                     <div class="button type02_h24px">
  166.                         <div class="v">
  167.                             <div class="buttonL"></div>
  168.                             <div class="buttonMain"><a href="#">knap text</a></div>
  169.                             <div class="buttonR"></div>
  170.                         </div>
  171.                     </div>
  172.                     <!-- end - module content -->
  173.                 </div>
  174.                 <div class="moduleContentBottom"><spacer width="1px" height="1px"></spacer></div>
  175.             </div>
  176.             <!-- end - module content area -->
  177.             <div class="moduleBottom"><spacer width="1px" height="1px"></spacer></div>
  178.         </div>
  179.         <div class="module type08Module">
  180.             <!-- module header area -->
  181.             <div class="headerArea" >
  182.                 <!-- ugly firefox fix -->
  183.                 <img src="images/transDot.gif" class="FF_Fix" />
  184.                 <!-- end - ugly firefox fix -->
  185.                 <div class="buttonDown" id="imgID02"></div>
  186.                 <h2>Newsletter</h2>
  187.                 <h3>- sign up now </h3>
  188.             </div>
  189.             <!-- end - module header area -->
  190.             <!-- module content are -->
  191.             <div class="moduleContentArea" id="contentID02">
  192.                 <div class="moduleContentTop"><spacer width="1px" height="1px"></spacer></div>
  193.                 <div class="moduleContent" >
  194.                     <!-- module content -->
  195.                     <p>great deals and good news straight to your inbox </p>
  196.                     <form name="form2" method="post" action="">
  197.                         <input name="textfield" type="text" class="size150w">
  198.                     </form>
  199.                     <div class="button type02_h24px">
  200.                         <div class="v">
  201.                             <div class="buttonL"></div>
  202.                             <div class="buttonMain"><a href="#">knap text</a></div>
  203.                             <div class="buttonR"></div>
  204.                         </div>
  205.                     </div>
  206.                     <!-- end - module content -->
  207.                 </div>
  208.                 <div class="moduleContentBottom"><spacer width="1px" height="1px"></spacer></div>
  209.             </div>
  210.             <!-- end - module content area -->
  211.             <div class="moduleBottom"><spacer width="1px" height="1px"></spacer></div>
  212.         </div>
  213.         <!-- end - modules goes here -->
  214.     </div>
  215.     <!-- end - right moduleArea -->
  216. </div>
Mar 22 '07 #1
Share this Question
Share on Google+
11 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Your links don't work.
Mar 22 '07 #2

drhowarddrfine
Expert 5K+
P: 7,435
Things like this will never work if width is supposed to be a html or css style:
class="leftModuleArea sideModuleArea width190"

There is no such thing as this:
<spacer width="1px" height="1px"></spacer>

I don't know if you misunderstand how to apply css styling or not. In addition, you have 30 html errors.

You also have a lot of comments about Firefox fixes which is unusual. It is usually IE that needs hacking and not FF.

Which doctype are you using?
Mar 22 '07 #3

P: 3
Links work now - some server syncro error.

I'm sorry but yes - it's a perfectly good and valid way to apply css. As long as I ensure that the different class declarations don't have overlapping properties there is no problems - for instance the width190 class does not affect the div directly, but the contents of it. each of the three classes fullfill different purposes. regarding:<spacer width="1px" height="1px"></spacer> - it's a hack and it prevents an undesired behavior in IE - completly unrelated to the problem I'm describing.

Regarding my html errors - neither are related to the problem and are merly formal not practical.

I'm using
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Things like this will never work if width is supposed to be a html or css style:
class="leftModuleArea sideModuleArea width190"

There is no such thing as this:
<spacer width="1px" height="1px"></spacer>

I don't know if you misunderstand how to apply css styling or not. In addition, you have 30 html errors.

You also have a lot of comments about Firefox fixes which is unusual. It is usually IE that needs hacking and not FF.

Which doctype are you using?
Mar 23 '07 #4

P: 3
Well, ... Success at last. After a great number of hours I finaly managed to eliminate the problem. instead of using display: inline I used display: table, and that did the trick. (I still consider it a FF bug though)
Mar 23 '07 #5

drhowarddrfine
Expert 5K+
P: 7,435
Debugging valid code is difficult enough without having to debug invalid code. I am not aware of any such issues with Firefox so it can only be attributed to your code.

I was confused with your class of width530 or whatever. It gave me the impression you were trying to style the width as that but, as you said, you can have multiple classes.

I recommend you use the strict doctype. New pages have no need for transitional.
Mar 23 '07 #6

P: 3
I'm having the same issue as the original poster with Firefox v2.0.0.3!

I have setup my code so that the specific error is easy to see. I have also tested my code to ensure that it's valid HTML (save the 1 intentional error in example 3, where a SELECT has no defined OPTIONs, yet the layout is correctly rendered by FF!?).

Any insights are greatly appreciated!

BTW... the original posters purposed "display: table;" fix didn't work for me, in fact example 4 shows that it's just the opposite for my example!?

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5.     <title>FF Flow Error</title>
  6.  
  7. <style type='text/css'>
  8. .inputform {
  9.     border: solid 1px #660000;
  10.     width: 790px;
  11.     display: table;
  12. }
  13. .displayblock {
  14.     display: block;
  15. }
  16.  
  17.  
  18. .aform label,
  19. .aform select,
  20. .aform input {
  21.     width: 150px;
  22.     float: left;
  23.     margin-bottom: 5px;
  24. border: solid 1px blue;
  25. }
  26.  
  27. .aform select {
  28.     display: table;
  29. }
  30.  
  31.     .aform label {
  32.         text-align: right;
  33.         padding-right: 20px;
  34.         clear: left;
  35.     }
  36.     .aform h1 {
  37.         clear: left;
  38.         padding: 0px;
  39.         margin: 0px;
  40.         font-weight: bold;
  41.         font-size: 14pt;
  42.         padding-top: 5px;
  43.     }
  44.  
  45. .RowBR,
  46. .ColumnBR {
  47.     float: left;
  48.     padding-right: 20px;
  49. border: solid 1px red;
  50. }
  51.     .RowBR {
  52.         clear: left;
  53.     }
  54.  
  55. </style>
  56. </head>
  57.  
  58. <body>
  59. <form action=''>
  60.  
  61.  
  62. <p>1) Errored Version:</p>
  63.     <div class='inputform'>
  64.         <div class='aform RowBR'>
  65.             <h1>Personal Information:</h1>
  66.  
  67.             <label for="FirstName1">Name</label>
  68.             <input id="FirstName1" name="FirstName1" type='text' value='Joe'>
  69.         </div>
  70.         <div class='aform ColumnBR'>
  71.             <h1>Contact Information:</h1>
  72.  
  73.             <label for="EMail1">EMail Address</label>
  74.             <input id="EMail1" name="EMail1" type='text' value='joe@bloggs.com.au'>
  75.         </div>
  76.  
  77.         <div class='aform RowBR'>
  78.             <h1>Physical Address:</h1>
  79.  
  80.             <label for="Address1">Address</label>
  81.             <input id="Address1" name="Address1" type='text' value=''>
  82.  
  83.             <label for="Country1">Country</label>
  84.             <select name='Country1' id='Country1'>
  85.                 <option>Australia</option>
  86.             </select>
  87.         </div>
  88.         <div class='aform ColumnBR'>
  89.             <h1>Mailing Address:</h1>
  90.  
  91.             <label for="MailingAddress1">Mailing Address</label>
  92.             <input id="MailingAddress1" name="MailingAddress1" type='text' value=''>
  93.  
  94.             <label for="MailingCountry1">Mailing Country</label>
  95.             <select name='MailingCountry1' id='MailingCountry1'>
  96.                 <option>Australia</option>
  97.             </select>
  98.         </div>
  99.     </div>
  100.  
  101.  
  102. <p>2) Working Version, without SELECT in first 'column':</p>
  103.     <div class='inputform'>
  104.         <div class='aform RowBR'>
  105.             <h1>Personal Information:</h1>
  106.  
  107.             <label for="FirstName2">Name</label>
  108.             <input id="FirstName2" name="FirstName2" type='text' value='Joe'>
  109.         </div>
  110.         <div class='aform ColumnBR'>
  111.             <h1>Contact Information:</h1>
  112.  
  113.             <label for="EMail2">EMail Address</label>
  114.             <input id="EMail2" name="EMail2" type='text' value='joe@bloggs.com.au'>
  115.         </div>
  116.  
  117.         <div class='aform RowBR'>
  118.             <h1>Physical Address:</h1>
  119.  
  120.             <label for="Address2">Address</label>
  121.             <input id="Address2" name="Address2" type='text' value=''>
  122.  
  123.             <label for="Country2">Country</label>
  124.             <input id="Country2" name="Country2" type='text' value=''>
  125.         </div>
  126.         <div class='aform ColumnBR'>
  127.             <h1>Mailing Address:</h1>
  128.  
  129.             <label for="MailingAddress2">Mailing Address</label>
  130.             <input id="MailingAddress2" name="MailingAddress2" type='text' value=''>
  131.  
  132.             <label for="MailingCountry2">Mailing Country</label>
  133.             <select name='MailingCountry2' id='MailingCountry2'>
  134.                 <option>Australia</option>
  135.             </select>
  136.         </div>
  137.     </div>
  138.  
  139.  
  140. <p>3) Weird Working Version, SELECT in first column without any defined OPTIONs:</p>
  141.     <div class='inputform'>
  142.         <div class='aform RowBR'>
  143.             <h1>Personal Information:</h1>
  144.  
  145.             <label for="FirstName3">Name</label>
  146.             <input id="FirstName3" name="FirstName" type='text' value='Joe'>
  147.         </div>
  148.         <div class='aform ColumnBR'>
  149.             <h1>Contact Information:</h1>
  150.  
  151.             <label for="EMail3">EMail Address</label>
  152.             <input id="EMail3" name="EMail3" type='text' value='joe@bloggs.com.au'>
  153.         </div>
  154.  
  155.         <div class='aform RowBR'>
  156.             <h1>Physical Address:</h1>
  157.  
  158.             <label for="Address3">Address</label>
  159.             <input id="Address3" name="Address3" type='text' value=''>
  160.  
  161.             <label for="Country3">Country</label>
  162.             <select name='Country3' id='Country3'>
  163.             </select>
  164.         </div>
  165.         <div class='aform ColumnBR'>
  166.             <h1>Mailing Address:</h1>
  167.  
  168.             <label for="MailingAddress3">Mailing Address</label>
  169.             <input id="MailingAddress3" name="MailingAddress3" type='text' value=''>
  170.  
  171.             <label for="MailingCountry3">Mailing Country</label>
  172.             <select name='MailingCountry3' id='MailingCountry3'>
  173.                 <option>Australia</option>
  174.             </select>
  175.         </div>
  176.     </div>
  177.  
  178.  
  179.  
  180. <p>4) Working Version, with outer DIV 'display: block;' rather then 'display: table;' (but note the 0px height outer DIV):</p>
  181.     <div class='inputform displayblock'>
  182.         <div class='aform RowBR'>
  183.             <h1>Personal Information:</h1>
  184.  
  185.             <label for="FirstName4">Name</label>
  186.             <input id="FirstName4" name="FirstName4" type='text' value='Joe'>
  187.         </div>
  188.         <div class='aform ColumnBR'>
  189.             <h1>Contact Information:</h1>
  190.  
  191.             <label for="EMail4">EMail Address</label>
  192.             <input id="EMail4" name="EMail4" type='text' value='joe@bloggs.com.au'>
  193.         </div>
  194.  
  195.         <div class='aform RowBR'>
  196.             <h1>Physical Address:</h1>
  197.  
  198.             <label for="Address4">Address</label>
  199.             <input id="Address4" name="Address4" type='text' value=''>
  200.  
  201.             <label for="Country4">Country</label>
  202.             <select name='Country4' id='Country4'>
  203.                 <option>Australia</option>
  204.             </select>
  205.         </div>
  206.         <div class='aform ColumnBR'>
  207.             <h1>Mailing Address:</h1>
  208.  
  209.             <label for="MailingAddress4">Mailing Address</label>
  210.             <input id="MailingAddress4" name="MailingAddress4" type='text' value=''>
  211.  
  212.             <label for="MailingCountry4">Mailing Country</label>
  213.             <select name='MailingCountry4' id='MailingCountry4'>
  214.                 <option>Australia</option>
  215.             </select>
  216.         </div>
  217.     </div>
  218.  
  219.  
  220. </form>
  221. </body>
  222. </html>
  223.  
  224.  
Apr 30 '07 #7

drhowarddrfine
Expert 5K+
P: 7,435
A quick response after having just gotten back into town.

Your doctype is incomplete. See the sticky at the top of this board. Haven't looked at the code but ALL new pages should use strict. I'll look at this more later.
May 1 '07 #8

drhowarddrfine
Expert 5K+
P: 7,435
It may have been better to start a new thread. I'm not sure of the problem so can you please state it.
May 1 '07 #9

P: 3
It may have been better to start a new thread. I'm not sure of the problem so can you please state it.
I found this thread researching this problem, and I believe it is indeed the same issue the original poster encountered. I figured that if I found it via Google and a solution was not found then I should contribute to the current thread, as opposed to starting a new one. As for a description of the issue...

All 4 examples should be positioned the same, but Example #1's "Mailing Address" DIV incorrectly wraps below the "Physical Address" DIV. This does not occur in Examples #2-4 (nor does it happen to Example #1's "Personal Information" and "Contact Information" DIVs) even though the same CSS is used across all the DIVs. Example #1 has the intended markup, but the CSS renders it incorrectly. Examples #2-4 have modified markup (read: not what I need it to be) to show that the CSS is properly applied in at least 3 differing cases.

It seems that under FireFox SELECTs (or their child OPTIONs) have some mystery CSS attribute applied to them that causes them to have an implicit "clear: right;" or "clear: both;"!? At least that seems to be the effect that is happening in this example.

I greatly appreciate your input on this problem, it's a real noodle-scratcher =)
May 2 '07 #10

P: 3
Agh, ha... well there you have it I guess... this is either a FireFox bug or there is simply no solution to the weird (and relativity basic) question.

Back to Google you go!



I found this thread researching this problem, and I believe it is indeed the same issue the original poster encountered. I figured that if I found it via Google and a solution was not found then I should contribute to the current thread, as opposed to starting a new one. As for a description of the issue...

All 4 examples should be positioned the same, but Example #1's "Mailing Address" DIV incorrectly wraps below the "Physical Address" DIV. This does not occur in Examples #2-4 (nor does it happen to Example #1's "Personal Information" and "Contact Information" DIVs) even though the same CSS is used across all the DIVs. Example #1 has the intended markup, but the CSS renders it incorrectly. Examples #2-4 have modified markup (read: not what I need it to be) to show that the CSS is properly applied in at least 3 differing cases.

It seems that under FireFox SELECTs (or their child OPTIONs) have some mystery CSS attribute applied to them that causes them to have an implicit "clear: right;" or "clear: both;"!? At least that seems to be the effect that is happening in this example.

I greatly appreciate your input on this problem, it's a real noodle-scratcher =)
May 8 '07 #11

drhowarddrfine
Expert 5K+
P: 7,435
I looked at it briefly but went out of town. Now I've got some problems that need taking care of so just haven't had the time. Yes, the solution isn't obvious to me.
May 8 '07 #12

Post your reply

Sign in to post your reply or Sign up for a free account.