Hey i was using google chrome to write html, css, JS. CSS frame work i will use Bootstrap.
so i was tested on Chrome my code design how i am expect it works perfect and fine, when it comes to another browsers like Firefox and Opera, Internet Explorer, Safari it was not much expectedly work.
Like Box shadow and linear gradient some other.
i saw some CSS have -webkit, -o, -moz etc...
What are those means? and how i can learn them?
Kindly please tell how i can able to target css for particular browser like Opera and Firefox and safari.
-moz #media(min-width: 320px) and (max-width: 767px) {
/*
Here i would like to target only firefox
*/
}
Some css properties are named depending on which browser is being used so we add what is called a prefix so its compatible with all of them. Let's see box shadow:
.shadow {
-webkit-box-shadow: 3px 3px 5px 6px #ccc; /* Safari 3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
-moz-box-shadow: 3px 3px 5px 6px #ccc; /* Firefox 3.5 - 3.6 */
box-shadow: 3px 3px 5px 6px #ccc; /* Opera 10.5, IE 9, Firefox 4+, Chrome 6+, iOS 5 */
}
There are autoprefixers also!
Related
I am trying to apply box-shadow on a div on hover in mozilla, chrome , IE10 it is working fine but in IE 8 text is also getting shaded i am attaching here image of IE8
and in mozilla it is working fine here is image
Here is my css for both
.span3:hover {
box-shadow:1px 1px 5px 5px #E7E0E7;
-webkit-box-shadow:1px 1px 5px 5px #E7E0E7;
-moz-box-shadow:1px 1px 5px 5px #E7E0E7;
border-radius:3px;
}
.lt-ie9 .span3:hover {
box-shadow:1px 1px 5px 5px #E7E0E7;
border-radius:3px;
zoom: 1;
filter:
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=0,strength=1),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=45,strength=1),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=90,strength=2),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=3),
progid:DXImageTransform.Microsoft.Shadow(color=#cccccc,direction=180,strength=10),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=225,strength=3),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=270,strength=2),
progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=315,strength=1);
}
Please explain me where i am doing mistake. i tried many links like css3pie.com etc but didn't get any solution.
Box Shadow Compatibility versions
It is not Supported in IE8
To Enable CSS box-shadow for IE
How to Simulate CSS3 box-shadow in IE6-8 Without JavaScript
or Use CSS3 PIE, which emulates some CSS3 properties in older versions of IE.
use CSS3 PIE
IE 8 not support css3 directly
I am looking at a fix for a website - I have applied a box-shadow to a div. This renders perfectly in:
Safari, Firefox, Chrome.
The SAME CSS renders perfectly in IE when displayed via ASP.NET razor views.
The CSS that works in the above .NET, doesn't render via Umbraco.
I am using a separate stylesheet for IE (8.0+) and using:
box-shadow: 5px 5px 0px #000
in the main stylesheet (for all other browsers) I am using:
box-shadow: 0px 40px 100px 2px #000;
neither work for IE and I am stumped now.
IE makes me want to drink bleach - anybody have any ideas where I am going wrong?
Thank you in advance!
This does indeed have to do with IE compatibility. Remove this line from your html:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
The line above forces newer versions of Internet Explorer to render the page as IE8 would, by default. See MSDN's Specifying legacy document modes for more details.
I'm guessing the link to your css is relative or something, it's got absolutely nothing to do with umbraco - you have full control over the html. Perhaps paste a link to your website or your html code.
also for cross browser drop shadows you need something like this
-moz-box-shadow: 3px 3px 4px #444;
-webkit-box-shadow: 3px 3px 4px #444;
box-shadow: 3px 3px 4px #444;
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#444444')";
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#444444');
I have a custom scroll bar accomplished by the code as shown here:
::selection {
background: #333;
color: #FFF;
}
::-webkit-scrollbar {
width: 9px;
}
::-webkit-scrollbar-track {
background:#eee;
border: thin solid lightgray;
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.1) inset;
}
::-webkit-scrollbar-thumb {
background:#999;
border: thin solid gray;
}
It works fine on Chrome, Firefox... but Internet Explorer it does not work
What should I add?
The CSS specified will only apply a custom scrollbar on a webkit browser such as Chrome and Safari. Internet Explorer only supports a limited amount of scrollbar customisation. See the MSDN reference and this IE scrollbar CSS generator.
Also, Firefox doesn't support custom scrollbars (bug report), so I'm not sure how your CSS is working in Firefox - it isn't for me.
If you want, you can use JavaScript-based jScrollPane to implement custom scrollbars in all browsers, but be warned, many people hate the user experience on JavaScript scrollbars, myself included.
Alright, so I'm trying to implement text-shadow across various browsers. I have IE6, IE7, FF, Chrome, and Opera all working... but IE8 wont' show any shadows unless it is in 'Compatibility View'.
I've looked at a number of 'solutions' via search / Google, but the shadow is still only appearing in 'Compatibility View'.
Any ideas on how to get it to show up without having to change modes?
Note: Using HTML5 Boilerplate and Modernizr.
edit: Added that I'm using Modernizr, and I clicked the wrong button in my tester. This isn't working in IE9 either, but I don't think it is related.
CSS:
#links li a {
font-size: 24px;
text-shadow: 0 3px 3px #102530, 0 3px 3px #102530;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=90, Color='#102530')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=90, Color='#102530');
filter:DropShadow(Color=#102530, OffX=0, OffY=3);
zoom: 1;
}
HTML
<ul id="links">
<li><a href="#"/>Text</a></li>
</ul>
I tried Modernizer (also with heygrady's polyfill). I tried cssSandpaper. I tried CSS3PIE. But none of them displayed me a text-shadow in Internet Explorer 8 (CSS3PIE doesn't feature text-shadow). I also tried the double-markup method. But that really can't be it.
And then I found Whykiki's blog post and simply added filter: dropshadow(color=#000000, offx=2, offy=2); in combination with display: block;. And that's it. Some of you might try zoom: 1; instead of display: block; to activate it. filter: glow(color=#000000,strength=2); works, too. As you will see, the MS dropshadow doesn't come with blur. I can live with that.
h1 {
color: #fce934;
text-shadow: 2px 2px 2px #000000;
-moz-text-shadow: 2px 2px 2px #000000;
-webkit-text-shadow: 2px 2px 2px #000000;
filter: dropshadow(color=#000000, offx=2, offy=2);
display: block; /* that's the important part */
}
A website must not necessarily look the same in every browser. Plus MS filters are crap.
I would recommend to use Modernizer an apply a different solution for IE8.
It will save you from headaches :)
If so, which PNG IE fix would you recommend?
If you do not necessarily need your CSS to validate, you might use this:
.box-shadow {
-moz-box-shadow: 2px 2px 3px #969696; /* FF 3.5+ */
-webkit-box-shadow: 2px 2px 3px #969696; /* Webkit = Safari + Chrome */
-khtml-box-shadow: 2px 2px 3px #969696; /* Konqueror */
box-shadow: 2px 2px 3px #969696; /* Opera */
filter: progid:DXImageTransform.Microsoft.Shadow(color='#969696', Direction=145, Strength=3); /* IE */
}
It uses the box-shadow CSS3 property where appropriate and for MSIE it uses filters. If you can trust your users have updated browser or use IE, you should be safe.
The code is not entirely from my head, I used http://www.smashingmagazine.com/2010/04/28/css3-solutions-for-internet-explorer/ for reference.
If your drop shadow is partially transparent and can't use a .gif then yes that is really the only way to go. Firstly, I must say the obligatory %^&* IE 6. Second, I have had great luck with http://jquery.andreaseberhard.de/pngFix/ but I loves me some jquery so take this as just personal opinion and if you arn't already using jquery may not be the best for you.