CSS Hack firefox 3.5 and below?
Is there any css hack for ff 3.5 and older (not 3.6) i used
.SubTabs ul, x:-moz-any-link
{
/* IE7,6 Hack*/
*top: -28px;
}
but this applies to all F开发者_如何学JAVAF browser versions..
Well solved it some what not 100% perfect but should work
/// <reference path="jquery-1.3.2-vsdoc2.js" />
$(document).ready(function() {
if ($.browser.mozilla) {
$('body').addClass("mozilla");
var versionParts = $.browser.version.split("\.");
var version = 0;
if (versionParts.length > 0) {
version = version + versionParts[0] * 1000000000000;
}
if (versionParts.length > 1) {
version = version + versionParts[1] * 1000000000;
}
if (versionParts.length > 2) {
version = version + versionParts[2] * 1000000;
}
if (versionParts.length > 3) {
version = version + versionParts[3] * 1000;
}
if (version >= 1009002000000) {
$('body').addClass("mozilla3-6andAbove");
}
else {
$('body').addClass("mozilla3-5andBelow");
}
}
});
now you can add body.mozilla3-5andBelow in your css file and it should work...
Use the @-moz-document at-rule to target any version of Firefox, then override that selector for Firefox 3.6+ using the @media -moz-scrollbar-start-backward media query:
@-moz-document url-prefix()
{
.SubTabs ul
{
top: -28px;
}
}
/* Firefox 3.6+ Filter */
@-moz-document url-prefix()
{
@media -moz-scrollbar-start-backward
{
.SubTabs ul
{
top: -10px;
}
}
}
Creating Firefox hacks for low end versions do require one for all, and a second one to override.
Here are a couple I created that do this.
The first one I posted to browserhacks.com so you may recognize it:
/* Firefox (any) */
_:-moz-tree-row(hover), .selector { top: 0px; }
Then the Override:
/* Firefox 3.6 and newer (use this to override) */
_:-moz-handler-crashed, :root .selector { top: -28px; }
To test these and many others live, you can try them out on my live css hacks test page: http://browserstrangeness.bitbucket.org/css_hacks.html#firefox
Enjoy!
精彩评论