How to apply a CSS transition only to the transform property
Tags: css,transform,css-transitions,transition,rotatetransform
Problem :
I've currently got a transform: rotate(45deg)
that is applied using a checkbox :checked
value, and I'm looking for a solution so the CSS transition only applies to the transform value. Right now I've got it setup like so: transition: all 1s ease
. I don't want it to apply to all though, just the transform. Right now it's applying the transition to a color:
change, which I'd like to get rid of.
I feel like this should have been easy to find an answer to, but it's proven to be more difficult than I had imagined. Let me know if you have any questions. Thanks.
Here's my code pen. The code in question is CSS lines 25-28.
Solution :
You can use transition: transform 1s;
That is shorthand for:
transition-property: transform;
transition-duration: 1s;
For prefixes, you need:
-webkit-transition: -webkit-transform 1s;
/* etc, for each possibility */
CSS Howto..
I found out what was happening - there was an extra div being created (parent of the canvas elements) with a class of 'canvas-container'. The position property was being overwritten....
HTML: <nav> <span>1</span> <span>2</span> <span>3</span> </nav> <div id="container"> </div> You should probably turn that into a list... CSS: nav { display: table; /* see below */ width: 1000px; } #container...
document.getElementById('divID').scrollIntoView(); try and see if that would do the job....
you can use media queries for that @media (max-width:768px){ .b, .a { display: block; float: none; height: auto; } } JS var flag =true; $( window ).resize(function() { if($(this).width() <=...
http://jsfiddle.net/JcG3k/2/ $("#vfb-7").change(function () { var fileName = $(this).val(); $("#filename-7").html(fileName); if (fileName != "") $(this).closest('li').next('li').show(); }); ...
This is my solution, but please, read @Chandranshu advices: HTML <form> <div class="iphone"> <div> <input type="text"/> <button></button> </div> </div> </form> CSS html { font-family: Arial, Helvetica, sans-serif; } div.iphone {...
if i understood correctly , you want something like this ? see snippet below or fiddle here > jsfiddle first i made the columns equal in height, because by default...
the structure you have is sass/scss/less. In css, you do it like so:- .parent-class .pagination { font-size: 10px } .parent-class a { font-size: 30px } ............... Once sass/scss/less is compiled,...
You can use Bootstrap's text-center and text-right classes to modify inner alignment of columns. <div class="row"> <div class="col-4"><img src="http://www.panext.com/wordpress/wp-content/uploads/2012/09/question-63916_640-400x200.jpg"></div> <div class="col-4 text-center"><img...
You can clear:both each message, it will do the effect you want. I also changed the .message margin to margin:10px 0; Update: to fix your problem #3. I changed the...
To bold some text in a paragraph you could use the <b>, <strong> tag or a <span> with styling set. These options would look like this: I want to <b>bold</b>...
I'm not sure why you need pure javascript, also this answer may not fit your needs as it actually does create inline CSS. But here it is, mostly taken from...
You can use conditionals to do this. In your add this code. <!--[if lt IE 8]> // Add your IE only stylesheet here <![endif]--> This means that if the browser...
You should never modify Boostrap's original files. The best option is to override their classes with your own ones. You can do this by creating a css file in your...
The solution was surprisingly easy i just needed to remove height: 100%; from .company.
From what i understand , you could have the className attribute defined inside your Component2's HTML tags. class Component2 extends Component{ render(){ return( <section className="component2styles"> This is Component2 </section >...
Not sure why you need someone to write your CSS for you, but there it is. :-) As others have hinted at, it's just a matter of reversing things somewhat....
The code that you had used was not wrong. Generally, the way to fill a SVG box or a shape with color is to make use of the fill property...
Easy solution: CSS: .staytop { position:relative/absolute; z-index:999; } To use z-index, you must use change the `position property....
Other than a few third party libraries that allow WinForms Skinning / Themeing, such as DevExpress, there isn't much you can do. And no, you cannot use HTML and CSS,...
i solved this by use flexbox: .group { display:-ms-flexbox; -ms-flex-align:center; -ms-flex-pack:start; -ms-flex-direction:column; -ms-flex-wrap:wrap; } ...
Install YSlow and Pagespeed plugins for Firefox. Then start looking at all of the ways your site is unoptimized. This will be much like trying to take a sip of...
That one's quite simple. Put the image in a container, and give it an after. Give that after a absolute position and a border. See the example: .gallery { height:...
Circles that scale based on size of content. This is something you will need to solve first, because you wont be able to place them anywhere without first knowing their...
You need to toggle the "paused" class on your containing div. You can do this at the end of your playPause function with this: videos[num].parentElement.classList.toggle('paused'); That's native DOM with only...
If I understand you right, you want to add an image which should still be centered even if the parent element's width is smaller than the image. This could be...
You can't expect others to download the repo and build it for you. Time matters! That's the first thing you need to learn how to ask a question properly on...
Google is your best friend, there are many free resources, but check out lynda.com, it has tons of videos and articles that will help you learn html, css, javascript, php....
You should use Cross Browser Zoom and Pixel Ratio Detector Code $(window).resize(function(){ var zoom = detectZoom.zoom(); var device = detectZoom.device(); alert("zoom: "+zoom +" , device:" +device); }); DEMO...
If you are using bootstrap and adding your own css rules than you will need to overwrite the styles your adding with !important If you want to go into bootstrap...