A very exciting topic! I tried the jQuery version and found out that even this would not work. In Firefox, the class must be applied first to work with freezing, as you can see in this Fiddle . But WebKit completely ignores the addition of a dynamic class :first-line .
<p class="hovered">Text .... </p>
For Firefox, the class must be set in the HTML code. Now the next task is performed.
jQuery('p').removeClass('hovered'); jQuery('p').hover(function() { jQuery(this).addClass('hovered'); }, function() { jQuery(this).removeClass('hovered'); });
But does not work in WebKit.
source share