MozTW 討論區 https://forum.moztw.org/ |
|
FF <Span> 定位問題 https://forum.moztw.org/viewtopic.php?f=13&t=10366 |
第 1 頁 (共 1 頁) |
發表人: | time1979 [ 2005-09-06, 17:28 ] |
文章主題 : | FF <Span> 定位問題 |
http://home.kimo.com.tw/tzeng_jin/uubox.htm 此網頁用IE 和 FF 看時 底下選單 "本館介紹" 的高度不相同 請問要如何才能使 FF的選單高度與IE相同 或是有更好的建議 謝謝~~ |
發表人: | 訪客 [ 2005-09-06, 22:11 ] |
文章主題 : | |
整理一下問題~ code 內容大致如下: 代碼: <TABLE>
<tr> <td> <IFRAME src="http://www.ubox.org.tw/food66/_file/2299/upload/theme/head.html" rameBorder=no scrolling="no"></IFRAME> </td> </tr> <tr> <td> <SPAN onmouseover="headbarFcmShow('0')" style="Z-INDEX: 19; LEFT: 298px; POSITION: absolute; TOP:150px" onmouseout="headbarFcmClose('0')"> </span> </td> </tr> </table> 問題應是出在這一段吧(猜測的啦) 在IE底下,Span裡的內容會在Iframe內容底下 但在FF時,Span裡的內容會被Iframe遮住 so....總覺得是span設定上的問題吧, 煩請各位大大看到低話給小弟一些寶貴低建議吧! 謝謝~~!~~~~~ ![]() |
發表人: | dken [ 2005-09-07, 00:04 ] |
文章主題 : | |
哇,這個網頁的 javascript 和 html code 真的是很亂。(小抱怨一下) 1. 這個網頁用 docuemnt.all 這個方式來取得 element,這種方式不符合 w3c 標準,自然 Firefox 也不支援,所以,你滑鼠移到 button 上時,Firefox 是不會有選單跳出來的,請愛用 document.getElementById() 這個 method。 2. 我看到的 html 原始碼是 引言回覆: <span style="z-index:19;position: absolute;left:202;top:0" onClick="location.href='/web/Home?_fcmID=1952107'"><a onMouseOut="img_pageheadbar(1-1,'btn')" onMouseOver="img_pageheadbar(1-1,'btnmor')" style="text-decoration:none;cursor:hand;z-index:15;"><font style="position:absolute;width:95;left:0; height:30;text-align:center;z-index:30;"><font style="position:relative;" id="pageheadbar">回首頁</font></font><img src="/food66/_file/2299/upload/page/headbarbtn.gif" border="0" alt="回首頁" style="position:relative;z-index:20;" id="imgheadbar"></a><!----><table onMouseOut="pageheadbarFcmShow('0','hidden')" onMouseOver="pageheadbarFcmShow('0','visible')" id="subpageheadbar" cellpadding="0" cellspacing="0" style="z-index:40;" border="0" width="100"></table><!----></span>
left:202;top:0; 這兩個應該是讓那個 menubar 跳到最上面的原因,IE 這部份會正常,還真是很奇怪,IE 的怪異判定真的領教了。 3. font 這個 tag 在 w3c 現行的標準應該是要棄用了(雖然 Firefox 可以接受),不過盡量用 css 在做,會方便許多。 |
發表人: | piaip [ 2005-09-07, 00:15 ] |
文章主題 : | |
dken 寫: 1. 這個網頁用 docuemnt.all 這個方式來取得 element,這種方式不符合 w3c 標準,自然 Firefox 也不支援,所以,你滑鼠移到 button 上時,Firefox 是不會有選單跳出來的,請愛用 document.getElementById() 這個 method。
小註解。 由於太多網頁的 JavaScript 其實都只差這個 document.all, Firefox 1.0 後其實有作對其簡單用法的支援, 不過 JavaScript Console 仍可能會跳一堆警告訊息出來, 所以還是建議換成 getElementById. |
發表人: | danielwang [ 2005-09-09, 08:45 ] |
文章主題 : | |
SPAN 是個 inline (字行間) 元素,不是個 block (區塊) 元素,所以定位應當無效。用 DIV 應該就可以了 |
發表人: | dken [ 2005-09-09, 13:21 ] |
文章主題 : | |
danielwang 寫: SPAN 是個 inline (字行間) 元素,不是個 block (區塊) 元素,所以定位應當無效。用 DIV 應該就可以了
只要加上 position: absolute 就可以用 span 定位了。 關於 display 和 position 的關係可以看這裡: http://www.w3.org/TR/CSS21/visuren.html#comparison ![]() |
發表人: | skyfate [ 2005-09-09, 15:51 ] |
文章主題 : | |
time1979 寫: http://home.kimo.com.tw/tzeng_jin/uubox.htm
此網頁用IE 和 FF 看時 底下選單 "本館介紹" 的高度不相同 請問要如何才能使 FF的選單高度與IE相同 或是有更好的建議 謝謝~~ 大概看了一下,一時之間也看不出來哪裡有問題?不過建議您改寫您的原始碼,將之分成兩部分: 1:<div>iframe…部分</div> 2:<div>「本館介紹」…部分</div> 然後在1或2的<div>中去做定位,這樣是不是比較簡單呢?如此一來,也方便日後的管理與維護。 P.S不建議使用iframe標籤,建議您使用object標籤。 |
第 1 頁 (共 1 頁) | 所有顯示的時間為 UTC + 8 小時 |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |