I have the following mixin for cross-browser transform:
.transform (...) {
-webkit-transform: #arguments; /* Chrome, Opera 15+, Safari 3.1+ */
-moz-transform: #arguments; /* Firefox 3.5+ */
-ms-transform: #arguments; /* IE 9 */
-o-transform: #arguments; /* Opera 10.5+ */
transform: #arguments; /* Firefox 16+, IE 10+, Opera */
}
.translate(#x:0, #y:0) {
.transform(translate(#x, #y));
}
And apply it something like the following:
#main {
.translate(280px, 0);
}
But it's not wotk in IE8 and Opera mini. Is there some fallback, polyfill or any for supporting it in therese browsers?
There are a few you can use, the ones suggested from modenizer are:
css sandpaper and transformie.
I'd argue though, that adding pollyfills to older browser like ie8 damages the performance of an already past it browser and lowers the user experience. Also, if you are adding pollyfills to mobile browsers you are adding to the loading times which in a 3g connection might put users off.
Related
I am having a bug I don't understand at all and that I can't find an solution for on the web.
My setup is pretty simple: I'm having a container with various children. The container (marked red in the screenshot) has a fixed height and overflow-y auto. Scrolling works just as expected.
.card-details-container {
height: 500px;
overflow-y: auto;
}
But when I change the opacity of one of the contained children, it is suddenly broken:
.barchart .barchart-bars div {
opacity: .5;
}
I am only experiencing this bug in Chrome (41.0.2272.118). I have no idea why this would be happening. Any help is appreciated!
Try:
/* Theoretically for IE 8 & 9 (more valid) */
/* ...but not required as filter works too */
/* should come BEFORE filter */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* This works in IE 8 & 9 too */
/* ... but also 5, 6, 7 */
filter: alpha(opacity=50);
/* Older than Firefox 0.9 */
-moz-opacity:0.5;
/* Safari 1.x (pre WebKit!) */
-khtml-opacity: 0.5;
/* Modern!
/* Firefox 0.9+, Safari 2?, Chrome any?
/* Opera 9+, IE 9+ */
opacity: 0.5;
Also, check the borders.
Rescaling iFrame content works in Chrome, but not other browsers. Any solutions? I'd like a cross-browser solution for rescaling an iframe to place a form in.
It doesn't rescale in IE8 and Firefox 15.0.1. It appears at 100% in these browsers, but is reduced in Chrome. Any thoughts?
<iframe src="http://www.apple.com/"
frameborder="0" noresize="noresize" scrolling="no"
width="66%" margin: 0 auto; align= "left "seamless="seamless"style="
-webkit-transform:scale(0.5);-moz-transform-scale(0.5);
width: 400px; height: 400px;"></iframe>
http://jsfiddle.net/DisEngaged/t9yhm/
You have made a small typo / used the wrong syntax for Firefox. You have used a - instead of a :.
Live example: http://jsfiddle.net/t9yhm/3/
Instead of:
-moz-transform-scale(0.5);
It should be:
-moz-transform:scale(0.5);
Also, it is worth noting that the latest versions of Firefox support the unprefixed version:
transform:scale(0.5);
EDIT :
Sorry, I've just noticed that you wanted a "cross-browser" solution. The CSS3 below will support the latest versions of Firefox, Chrome and IE9+ :
iframe{
width: 400px;
height: 400px;
margin: 0 auto;
-webkit-transform: scale(0.5);
-moz-transform: scale(0.5);
-ms-transform: scale(0.5);
transform: scale(0.5);
}
For IE8 and below there is a filter you can use, but it has a complicated syntax:
/* IE8+ - must be on one line*/
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.5, M12=0, M21=0, M22=0.5, SizingMethod='auto expand')";
/* IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.Matrix(
M11=0.5,
M12=0,
M21=0,
M22=0.5,
SizingMethod='auto expand');
To help you calculate the matrix values you can use this site: http://www.useragentman.com/IETransformsTranslator/
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
CSS rotate property in IE
Can any one help here to rotate the text on IE- 8, IE -7 versions.
it is working on Chome, firefox, IE-9, but doesn`t have any results on IE-8, IE- 7.
BETA
css
a.beta_home{
position: absolute;
text-decoration: none;
top: 12px;
right:0;
margin-left: 0px;
font-size: 9px;
color:red;
border: 1px solid #fff;
display: block;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
i wouldn't pref to do it in any browser cause they all render it very different.. but you could do it with javascript
Documentation
http://code.google.com/p/jquery-rotate/
Commands
$('#theimage').rotateRight(45);
$('#theimage').rotateLeft();
This would render it the same in IE 9, chrome, firefox, opera and safari cause its using a canvas object instead of turning the text by browser rendering
It will use the old codings for ie8, 7 & 6 Generate it here
/* IE8+ - must be on one line, unfortunately */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=-0.1763269807084645, M21=0, M22=1, SizingMethod='auto expand')";
/* IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.Matrix( M11=1, M12=-0.1763269807084645, M21=0, M22=1, SizingMethod='auto expand');
Working ex
IE 7&8 tested
Fiddle (margins need to be different in chrome and other browsers cant say why but it does)
If you dont know how to differ css trough out the different browsers see this link
My opinion
Beside all this i would recommend you make it as a picture (already rotated) using photoshop or if your dont have access to such programs use free (GIMP)
Try to use this online service:
http://www.useragentman.com/IETransformsTranslator/
It transform css3 rule
rotate(-90deg)
applied on div with WIDTH: 220px; HEIGHT: 70px;
to IE specific rules:
/*
* The following two rules are for IE only and
* should be wrapped in conditional comments.
* The -ms-filter rule should be on one line
* and always *before* the filter rule if
* used in the same rule.
*/
#transformedObject {
/* IE8+ - must be on one line, unfortunately */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=3.061515884555943e-16, M12=1, M21=-1, M22=3.061515884555943e-16, SizingMethod='auto expand')";
/* IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.Matrix(
M11=3.061515884555943e-16,
M12=1,
M21=-1,
M22=3.061515884555943e-16,
SizingMethod='auto expand');
/*
* To make the transform-origin be the middle of
* the object. Note: These numbers
* are approximations. For more accurate results,
* use Internet Explorer with this tool.
*/
margin-left: 71px;
margin-top: -78px;
}
/* IE8+ - must be on one line, unfortunately */
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=-0.1763269807084645, M21=0, M22=1, SizingMethod='auto expand')";
/* IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.Matrix( M11=1, M12=-0.1763269807084645, M21=0, M22=1, SizingMethod='auto expand');
/* For IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
is there a way to make my website automatically zoom out to 90% ?
Thanks
This can be done with css3 scale attribute but beware that this is not support on all browsers.
http://www.w3schools.com/css3/css3_2dtransforms.asp/
body{
transform: scale(0.9);
-ms-transform: scale(0.9); /* IE 9 */
-webkit-transform: scale(0.9); /* Safari and Chrome */
-o-transform: scale(0.9); /* Firefox */
}
Or with jquery and javascript for cross browser by appending a div around the content off the site and scaling to 90% off the body width;
Something roughly like
var bdwidth = $("body").width();
$("wrapper").width((bdwidth / 100)*90);
Use CSS
body {
-moz-transform: scale(0.9, 0.9); /* Moz-browsers */
zoom: 0.9; /* Other non-webkit browsers */
zoom: 90%; /* Webkit browsers */
}
This worked for me!
I am trying to rotate text by using LESS
Simply, I try the following code but it does not work.
.my-class {
color: #ff0000;
.rotate(90);
}
Here is my jsfiddle http://jsfiddle.net/D2RLR/2750/
Did you try adding a unit? (or an unit Mr president?)
.rotate(90deg)
See MDN about CSS3 transform and rotate for more information. That's what LESS.js or lessphp will output
To make css rotation work on all browsers including ie7 through ie10 using LESS, I am using a mixin like this:
.rotate(#deg: 90) {
/* Safari */
-webkit-transform: rotate(#deg * 1deg);
/* Firefox */
-moz-transform: rotate(#deg * 1deg);
/* IE10+ */
transform: rotate(#deg * 1deg);
/* Opera */
-o-transform: rotate(#deg * 1deg);
/* Internet Explorer */
#IEdeg: round(#deg / 90, 0);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#IEdeg);
}
#divToRotate {
.rotate(270);
}
But you won't be able to run this in js fiddle since this will need to be compiled by lessc compiler or using the less js parser.
You can simply write it in plain CSS, and it will work in LESS: transform: rotate(90deg);.
Try something like this:-
.box_rotate {
-moz-transform: rotate(7.5deg); /* FF3.5+ */
-o-transform: rotate(7.5deg); /* Opera 10.5 */
-webkit-transform: rotate(7.5deg); /* Saf3.1+, Chrome */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083); /* IE6,IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */
}
Check this link:- http://snook.ca/archives/html_and_css/css-text-rotation
I recommend using the LESS library: LESS Elements it has a mixin for rotate which seems to work in lots of browsers:
.rotation(15deg); Rotates the item by a number of degrees clockwise.