Wednesday 21 September 2011

How to fix the following problem in FireFox browser using CSS and HTML?

The following codes work fine using IE7 and Chrome browsers. However, when I use FireFox , it does not work properly. By the way, the following code should change the text language when you hover your mouse.



%26lt;head%26gt;

%26lt;title%26gt;Test%26lt;/title%26gt;

%26lt;/head%26gt;

%26lt;style type=%26quot;text/css%26quot;%26gt;

%26lt;!--

#tablist{ padding: 3px 0; margin: 0; float: left; }

#tablist li{ list-style: none; display: inline; margin: 0; color:#000000 }

#tablist li a{

text-decoration: none;

padding: 4px 22px;

margin-right: 2px;

background:#0080C0 url(images/corner.gif) no-repeat top right;

font-weight: bold;

color:#FFFF00;

}

a span.farsi, a:hover span.en {

display: inline;

}

a:hover span.farsi, a span.en {

display: none;

}



#tablist li a:hover{

background:#FF0000 url(images/corner.gif) no-repeat top right;

color:#FFFFFF;

}

#tablist li a.current{

background: #9FC7D8 url(images/corner.gif) no-repeat top right;

color: #2F637A;

padding: 6px 22px;

}

#tablist .key { text-decoration: underline; }





--%26gt;

%26lt;/style%26gt;

%26lt;body%26gt;

%26lt;ul id=%26quot;tablist%26quot;%26gt;

%26lt;li%26gt;%26lt;a href=%26quot;aboutus.html%26quot;%26gt; %26lt;span class=%26quot;farsi%26quot;%26gt;丿乇亘丕乇賴 賲丕%26lt;/span%26gt;聽%26lt;span class=%26quot;en%26quot;%26gt;About Us%26lt;/span%26gt;%26lt;/a%26gt;%26lt;/li%26gt;

%26lt;li%26gt;%26lt;a href=%26quot;archive.html%26quot;%26gt;%26lt;span class=%26quot;farsi%26quot;%26gt;丌乇卮蹖賵 亘乇賳丕賲賴 賴丕%26lt;/span%26gt;聽%26lt;span class=%26quot;en%26quot;%26gt;Archive%26lt;/span%26gt;%26lt;/a%26gt;%26lt;/li%26gt;

%26lt;/ul%26gt;

%26lt;/body%26gt;

%26lt;/html%26gt;
How to fix the following problem in FireFox browser using CSS and HTML?
This script highlights the background of a %26lt;TD%26gt;, and works on ALL browsers:

The call:

%26lt;td id = %26quot;id1%26quot; onMouseover = %26quot; js_highlight(this,'id1') %26quot; onMouseout = %26quot; js_restore (this,'id1') %26quot; %26gt;



The function:

function js_highlight(x,id)

{

var iex = document.getElementById(id);

iex.style.backgroundImage = %26quot;url(pics/bkgnavon.jpg)%26quot;; // FOR IE

x.style.backgroundImage = %26quot;url(pics/bkgnavon.jpg)%26quot;; // WORKS ON ALL PASSING %26quot;THIS%26quot;

}

function js_restore(x,id)

{

var iex = document.getElementById(id);

iex.style.backgroundImage = %26quot;url(pics/bkgnav.jpg)%26quot;; // FOR IE

x.style.backgroundImage = %26quot;url(pics/bkgnav.jpg)%26quot;; // WORKS ON FF (PASSING %26quot;THIS%26quot;)

}
How to fix the following problem in FireFox browser using CSS and HTML?
You're writing IE-specific code. Write normal code and butcher it for IE. (You're doing it backwards - accommodating the broken browsers, then looking for a way to make browsers that work correctly work on your broken code.)
  • rodents
  • monitor upgrade drivers
  •