Edit This Code:
See Result »
<!DOCTYPE html> <html> <head> <style> #myDIV { background-color: lightblue; overflow: auto; border: 1px solid black; -webkit-animation: mymove 5s infinite; /* Chrome, Safari, Opera */ animation: mymove 5s infinite; } /* Chrome, Safari, Opera */ @-webkit-keyframes mymove { 50% {max-width: 600px;} } /* Standard syntax */ @keyframes mymove { 50% {max-width: 600px;} } </style> </head> <body> <p>Change the max-width, from "none" to "600px" and back to "none":<p> <div id="myDIV"> <p>This DIV element does not have a pre-defined width.</p> <p>Try resizing the browser window to see that width of this DIV element will grow/shrink along width the resizing, but it will never exceed 600 pixels in width.</p> </div> <p>The max-width property is <em>animatable</em> in CSS.</p> <p><b>Note:</b> Currently the max-width property is not changing <em>gradually</em> in Chrome, and does not change at all in Firefox.</p> <p><b>Note:</b> CSS Animations do not work in Internet Explorer 9 and earlier versions.</p> </body> <!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_anim_max-width by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 13 Mar 2016 11:04:44 GMT --> </html>
Result: