Animating the CSS flex-grow property

WBOY
Release: 2023-08-26 23:45:14
forward
707 people have browsed it

动画 CSS flex-grow 属性

To animate on the Flex-grow property using CSS, you can try running the following code

Example h2>

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mycontainer {
            display: flex;
            background-color: red;
            align-content: space-between;
         }
         .mycontainer > div {
            background-color: white;
            text-align: center;
            line-height: 40px;
            font-size: 25px;
            width: 100px;
            margin: 5px;
         }
         div {
            animation: myanim 4s infinite;
         }
         @-webkit-keyframes myanim {
            30% {
               flex-grow: 3;
            }
         }
      </style>
   </head>
   <body>
      <h1>Quiz</h1>
      <div class = "mycontainer">
         <div style = "flex-grow: 1">A1</div>
         <div style = "flex-grow: 1">A2</div>
         <div style = "flex-grow: 20">A3</div>
         <div style = "flex-grow: 1">A4</div>
         <div style = "flex-grow: 1">A5</div>
      </div>
   </body>
</html>
Copy after login

The above is the detailed content of Animating the CSS flex-grow property. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!