HTML Code:
<!DOCTYPE html><!-- Declaration of HTML5 document type -->
<html>
<head>
<title>How to set the border-left-width animatable</title><!-- Title of the HTML document -->
<style type="text/css">
/* CSS styling */
#mydiv {
width: 200px;
height: 150px;
border: 1px solid #CC63FF; /* Sets the border style for the 'mydiv' element */
-webkit-animation: mymove 5s infinite; /* Initiates an animation with CSS for WebKit browsers */
animation: mymove 5s infinite; /* Initiates an animation with CSS for all browsers */
}
@keyframes mymove { /* Defines a keyframe animation called 'mymove' */
50% {border-left-width: 15px;} /* Specifies that at 50% of the animation duration, the left border width of the 'mydiv' element should be 15 pixels */
}
</style>
</head>
<body>
<p>w3resource Tutorial</p><!-- Paragraph content -->
<div id="mydiv">Border left width animatable</div><!-- Div element with the left border width set to be animatable -->
</body>
</html>
Explanation:
Live Demo:
See the Pen border-left-width-animatable-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4