css-hack

How to write a CSS hack for IE 11? [duplicate]

旧巷老猫 提交于 2019-11-26 11:56:51
This question already has an answer here: Detecting IE11 using CSS Capability/Feature Detection 18 answers How can I hack or write css only for IE 11? I have a website that looks bad in IE 11.I just search here and there but didnt find any solution yet. Is there any css selector? Use a combination of Microsoft specific CSS rules to filter IE11: <!doctype html> <html> <head> <title>IE10/11 Media Query Test</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <style> @media all and (-ms-high-contrast:none) { .foo { color: green } /* IE10 */ *::-ms-backdrop, .foo {

How to make CSS visible only for Opera

帅比萌擦擦* 提交于 2019-11-26 08:51:50
问题 Is there a way to make some CSS rules visible only for Opera (9.5 +)? 回答1: This hack works for the latest Opera: @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { #id {css rule} } It doesn't touch any other browser as far as i tested, but this may be actual for several months, with web technologies boom etc. 回答2: works great for Opera 10.63 noindex:-o-prefocus, .class { color:#fff; } 回答3: With pure CSS hack you might be unable to safely

How to apply specific CSS rules to Chrome only?

落花浮王杯 提交于 2019-11-26 07:58:22
Is there a way to apply the following CSS to a specific div only in Google Chrome? position:relative; top:-2px; Martin Kristiansson CSS Solution from https://jeffclayton.wordpress.com/2015/08/10/1279/ /* Chrome, Safari, AND NOW ALSO the Edge Browser and Firefox */ @media and (-webkit-min-device-pixel-ratio:0) { div{top:10;} } /* Chrome 29+ */ @media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) { div{top:0;} } /* Chrome 22-28 */ @media screen and(-webkit-min-device-pixel-ratio:0) { .selector {-chrome-:only(; property:value; );} } JavaScript Solution if (navigator

Target IE9 Only via CSS

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 07:29:37
问题 Just wondering given these IE hacks in my bag of tricks \"\\9\" - for IE8 and below. \"*\" - for IE7 and below. \"_\" - for IE6. i.e. such as body { border:2px solid blue; border:2px solid yellow \\9; *border:2px solid green; _border:2px solid orange; } Whether anyone has such a hack for IE9 ? i.e. I\'m trying to target IE9 only via CSS ? 回答1: I suggest using condcoms to feed an IE9 css file or have a conditional html class, similar to: <!--[if lt IE 7]> <html lang="en-us" class="no-js ie6">

How to write a CSS hack for IE 11? [duplicate]

倾然丶 夕夏残阳落幕 提交于 2019-11-26 02:39:32
问题 This question already has answers here : Detecting IE11 using CSS Capability/Feature Detection (18 answers) Closed 4 years ago . How can I hack or write css only for IE 11? I have a website that looks bad in IE 11.I just search here and there but didnt find any solution yet. Is there any css selector? 回答1: Use a combination of Microsoft specific CSS rules to filter IE11: <!doctype html> <html> <head> <title>IE10/11 Media Query Test</title> <meta charset="utf-8"> <meta http-equiv="X-UA

How to apply specific CSS rules to Chrome only?

a 夏天 提交于 2019-11-26 01:52:46
问题 Is there a way to apply the following CSS to a specific div only in Google Chrome? position:relative; top:-2px; 回答1: CSS Solution from https://jeffclayton.wordpress.com/2015/08/10/1279/ /* Chrome, Safari, AND NOW ALSO the Edge Browser and Firefox */ @media and (-webkit-min-device-pixel-ratio:0) { div{top:10;} } /* Chrome 29+ */ @media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) { div{top:0;} } /* Chrome 22-28 */ @media screen and(-webkit-min-device-pixel-ratio

CSS \9 in width property

落花浮王杯 提交于 2019-11-26 01:37:37
问题 What is the meaning of this? I am guessing it is a browser hack, but I have not been able to find what exactly it does. width: 500px\\9; What is the significance of \\9 ? 回答1: \9 is a "CSS hack" specific to Internet Explorer 7, 8, & 9. This simply means that the one specific line of CSS ending with a \9; in place of the ; is only valid in IE 7, 8, & 9. In your example, width: 500px\9; means that a width of 500 pixels (same result as width: 500px; ) will only be applied while using IE 7, 8, &

Targeting only Firefox with CSS

不羁的心 提交于 2019-11-25 22:08:21
问题 Using conditional comments it is easy to target Internet Explorer with browser-specific CSS rules: <!--[if IE 6]> ...include IE6-specific stylesheet here... <![endif]--> Sometimes it is the Gecko engine (Firefox) that misbehaves. What would be best way to target only Firefox with your CSS rules and not a single other browser? That is, not only should Internet Explorer ignore the Firefox-only rules, but also WebKit and Opera should. Note: I\'m looking for a \'clean\' solution. Using a