I am using zoom: 0.5; and it is working fine on my site, but when I add moz-transform: scale(0.5); and moz-transform-origin: 0 0; To make the site Firefox compatible, the fixed positioned elements I have become unfixed and not placed in the correct place (to the top and left of where they should be). The site works as intended in chrome, and this only happens in Firefox.
Here is the code
.mobPopUp{
position: fixed;
width: 500px;
height: 200px;
border: 5px solid black;
text-align: center;
font-size: 24px;
font-weight: 900px;
color: lime;
bottom: 0px;
text-shadow: 3px 3px black;
}
#mobPopUpBlue{
right: 0px;
background-color: blue;
}
html{
zoom:0.5;
-moz-transform: scale(0.5);
-moz-transform-origin: 0 0
}
<div id="mobPopUpred" class="mobPopUp">Right click on a mob to see their stats here</div>
What am I doing wrong? And how can I have it so it works on Firefox as it does on Chrome with zoom
There isn't really a CSS zoom property, it's just a non-standard property invented by Internet Explorer and adopted by some other browsers for compatibility reasons. The correct property to use for scaling transformations is the transform property.
Firefox has long since remove the -moz- vendor prefix, and never implemented zoom, so that's probably why your code does nothing in Firefox, but for maxium browser support, you can use the below.
-webkit-transform: scale(0.5);
-moz-transform: scale(0.5);
-ms-transform: scale(0.5);
-o-transform: scale(0.5);
transform: scale(0.5);
That will work in pretty much anything IE9 or better. If you need IE8 support, then you might try adding zoom in an IE <= 8 CSS hack.
Related
This question already has answers here:
Incorrect border rendering when using css transform in Firefox
(3 answers)
Closed 4 years ago.
In Firefox, I'm having an issue where the css generated arrow renders the border properties with a cut-through outline at the center point. Is there a fix for this?
It renders perfectly fine in all other modern browsers where the border outline isn't visible and shows a clear arrow.
The bug is only visible in Firefox.
All other browsers (Chrome, Edge, Opera, IE11):
Firefox:
.bx-prev, .bx-next {
border-right: 15px solid green;
border-bottom: 15px solid green;
width: 35px;
height: 35px;
transition: .25s all;
cursor: pointer;
z-index: 10000;
}
.bx-prev {
transform: rotate(135deg);
position: absolute;
top: 120px;
left: 220px;
}
.bx-next {
transform: rotate(-45deg);
position: absolute;
top: 120px;
right: 420px;
}
<a class="bx-prev"></a>
<a class="bx-next"></a>
Use translateZ(1px) with rotate property value
transform:translateZ(1px) rotate(-45deg)
This seems to be, how Firefox is translate the element using the matrix value in transform property.
Another way to solve such things is making a svg element or getting one from fontawesome, download the .svg file. Using https://www.figma.com, to easily manipulate it and voilá.
The following code works in all browsers except for IE.10.
MSDN website says the following (which I do not understand how to apply):
Note The W3C specification defines a keyword value of preserve-3d for this property, which indicates that flattening is not performed. At this time, Internet Explorer 10 does not support the preserve-3d keyword. You can work around this by manually applying the parent element's transform to each of the child elements in addition to the child element's normal transform.
https://msdn.microsoft.com/en-gb/library/ie/hh673529(v=vs.85).aspx
My code (I'm using CSS selectors for other reasons):
div[class^="flip"] {
display: inline-block;
}
div[class^="flip"] {
-webkit-perspective: 800;
-moz-perspective: 800;
-ms-perspective: 800;
-o-perspective: 800;
perspective: 800;
width: 313px;
height: 480px;
position: relative;
margin-right: 10px;
margin-left: 10px;
}
div[class^="flip"] .card.flipped {
-webkit-transform: rotatey(-180deg);
-moz-transform: rotatey(-180deg);
-o-transform: rotatey(-180deg);
transform: rotatey(-180deg);
}
div[class^="flip"] .card {
width: 100%;
height: 100%;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
-o-transition: 0.5s;
transition: 0.5s;
}
div[class^="flip"] .card .face {
width: 100%;
height: 100%;
position: absolute;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 2;
text-align: center;
}
div[class^="flip"] .card .front {
position: absolute;
z-index: 1;
background: #F5F5F5;
border: #DDD 1px solid;
}
div[class^="flip"] .card .back {
-webkit-transform: rotatey(-180deg);
-moz-transform: rotatey(-180deg);
-o-transform: rotatey(-180deg);
transform: rotatey(-180deg);
background: #F5F5F5;
border: #DDD 1px solid;
}
<div class="flip1">
<div class="card">
<div class="face front">Front content</div>
<div class="face back">Back content</div>
</div>
</div>
Could you please help me with this?
Internet Explorer 10 and 11 only partially support 3D transforms. (Older versions of Internet Explorer do not support this property).
Internet Explorer 10 and 11 'have only partial support' because:
not supporting the transform-style: preserve-3d property. This
prevents nesting 3D transformed elements.
further Reading
This property is suggested to be implemented in the next version of internet explorer, so unfortunately the current IE doesn't really support any 'good' or 'complex' 3D functionality.
Since IE will 'ignore' this property, you may be able to display a message of banner to inform users to use Chrome or Firefox for better experience (it also means you will have to implement less browser hacks to support IE in general).
In answer to your question
Note The W3C specification defines a keyword value of preserve-3d for
this property, which indicates that flattening is not performed. At
this time, Internet Explorer 10 does not support the preserve-3d
keyword. You can work around this by manually applying the parent
element's transform to each of the child elements in addition to the
child element's normal transform.
This is suggesting to apply the transform of the parent manually on the child element. So the 3d transform stated on your parent (.flip1) should also be placed on your child element(s) (.back and .front) as well.
In all versions of IE, preserve-3d does not work. In Microsoft Edge, it does.
You can apply a 3D transformation to any element, but if it's parent is 3D transformed as well then the transformation will NOT work; the element will be flattened
so IE10 or IE11 = no fun in 3D.
I want to have the bottom curved in my Header Div. Basically the div should be slanted, i tried the below, and its working in all latest browser's except ie8 & below
<div class="HeaderTitle" style="background: #000;">
<h1 class="header">
PROMOTIONS</h1>
</div>
#Container #InnerPages .HeaderTitle
{
padding: 115px 0 0 0; background-color: #000;
margin-right: -20px;
-webkit-transform: rotate(5deg); /* Safari and Chrome */
-moz-transform: rotate(5deg); /* Firefox */
-o-transform: rotate(5deg); /* Opera */
-ms-transform: rotate(5deg); /* IE 9 */
transform: rotate(5deg);
}
#Container #InnerPages .header
{
text-align: center; color: #fff; font-size: 30px; margin: 0; padding: 0 0 26px;
-webkit-transform: rotate(-5deg); /* Safari and Chrome */
-moz-transform: rotate(-5deg); /* Firefox */
-o-transform: rotate(-5deg); /* Opera */
-ms-transform: rotate(-5deg); /* IE 9 */
transform: rotate(-5deg);
}
But this doesnt work in IE & my client is very adamant that it should work in IE 8 :-(
Any help please...
Solution 1
Use IETransformsTranslator
It's an on-line tool With this tool you can make matrix filter transforms what works on IE6,IE7 & IE8. Just paste you CSS3 transform functions (e.g. rotate(15deg) ) and it will do the rest.
Solution 2
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
The rotation property of the BasicImage filter can accept one of four values: 0, 1, 2, or 3 which will rotate the element 0, 90, 180 or 270 degress respectively.
Solution 3
Since this answser is still getting up-votes, I feel I should update it with information about a javacript library called CSS Sandpaper that allows you to use (near) standard CSS code for rotations even in older IE versions.
Once you've added CSS Sandpaper to your site, you should then be able to write the following CSS code for IE6-8:
-sand-transform: rotate(25deg);
Hope this helps you :)
Basically you want curves for IE8
This will help
.div
{
-webkit-border-radius:4px; /* older webkit based browsers */
-khtml-border-radius:4px; /* older khtml based browsers */
-moz-border-radius:4px; /* older firefox */
border-radius:4px; /* standard */
behavior: url(border-radius.htc); /* IE 6-8 */
}
I am trying to write up some CSS for a company logo that is a fairly accurate depiction of the jpg currently on the company server. its pretty basic except for some color overlays on the logo.
My question is:
is this even possible? if so how can i go about doing so
please dont bash, im a total noob, my first line of html was about a week ago...
Here is my markup
<html>
<head>
<meta charset="utf-8"/>
<title>
</title>
<link rel="stylesheet" href="css/stylesheet.css"
</head>
<style contenteditable="">
#infinity {
position: absolute;
width: 212px;
height: 100px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#infinity:before,
#infinity:after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 60px;
height: 60px;
border: 15px solid;
-moz-border-radius: 50px 50px 0 50px;
border-radius: 50px 50px 0 50px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#infinity:before{
color: #ADB2B3;
}
#infinity:after {
left: auto;
right: 15;
color: #A99055;
-moz-border-radius: 50px 50px 50px 0;
border-radius: 50px 50px 50px 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
</style>
<body>
<br>
<br>
<div>
<div>
<div style="float:left; margin-right: 0px;"id="infinity">
</div>
<div>
<p style="float:left; margin-top:70px; margin-left:130px; font-size:60px;
font-family: Avenir, sans-serif;">
PORTFOLIO
</p>
</div>
</div>
</body>
</html>
Check this out: http://jsfiddle.net/tMEqk/1/
It's not quite there, but it's closer
I made a relatively positioned container and then drew out each loop from there, positioned everything according to the box. Changed the border to get the continuous effect and then obscured the diagonal line generated by a gold box. There's no rotation either, but if you want to change the size there's a little bit of math to be done. Did it in Chrome, haven't checked other browsers yet.
Edit
I'm not exactly condoning this, but I did enjoy trying to recreate it. This really should be an image, and you can prevent the broken image by saving and referencing it as a local file.
Just so I am straight. You are trying to create the entire logo with CSS? Is this correct? If so, why CSS versus using the JPEG? If you are using straight CSS you will be limited to what you can do, also most of it would be CSS3 and browser hacks, which poses a couple of problems.
The first being CSS3 is only supported in modern browsers.
The second being browser hacks don't pass W3 CSS validation.
This is not an answer, really, but I would strongly suggest that you can at most try to make a scalable vector image out of that logo, using Inkscape or such programs. This logo will be very easy to convert to SVG (scalable vector graphics). But as Kris said, using CSS to accomplish all of this may not perform as intended in many situations.
Does anybody know if there's a double chevron symbol in unicode/HTML-space similar to the double guillemet represented by » (»)?
In other words, I'm trying to avoid using an image if I can get by with text, but I need something like this:
It's the double chevron I can't seem to figure out. Looks like graphics for me it is.
May be this site will help you http://shapecatcher.com/ , very useful!
︽ U+FE3D PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
︾ U+FE3E PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
These require a Chinese or Japanese font though.
I can't give you the character entity that you want, but it's possible to effect an...alternative, and still not use images (though it does require that the text itself be wrapped in an element, in this case span):
<span class="shadowed">^</span>
<span class="rotated">»</span>
CSS:
span { /* this is all, pretty much, just for the aesthetics, and to be adapted */
margin: 0 auto 1em auto;
font-family: Helvetica, Calibri, Arial, sans-serif;
font-size: 2em;
font-weight: bold;
color: #000;
background-color: #ffa;
display: block;
width: 2em;
height: 2em;
line-height: 2em;
border-radius: 0.5em;
text-align: center;
}
span.shadowed {
text-shadow: 0 0.5em 0 #000;
}
span.rotated {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
JS Fiddle demo.
The above span.rotated section, for IE < 10 compatibility (using filters, whereas IE 10 (or possibly 9) would/should use the -ms-transform or, simply, transform CSS3), using a filter approach:
span.rotated {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
/* IE < 10 follows */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
JS Fiddle demo (works in IE 7/XP, other versions I'm unable to test).
There's a problem with rotation. If you apply rotation(90deg) and rotation(-90deg) to two separate » you'll see that their position changes. A hacky way to fix it is to apply direction: rtl like this:
http://codepen.io/tomasz86/pen/lmCaL