CSS hover扩大宽度
![图片.png](data/attachment/forum/202211/23/211026a6cqlc16c4u8qaoq.png)![图片.png](data/attachment/forum/202211/23/211036w770p2z55ckyc53z.png)
![图片.png](data/attachment/forum/202211/23/211043lvb4bvqh69dvq5t9.png)
代码如下
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div class="wrap">
<div class="block1"></div>
<div class="block2"></div>
</div>
</body>
<style>
.wrap {
width: 800px;
background-color: black;
height: 240px;
display: flex;
}
.block1 {
background-color: red;
flex: 1 1 0;
transition: all 1s;
}
.block2 {
background-color: yellow;
flex: 1 1 0;
transition: all 1s;
}
.block1:hover,
.block2:hover {
flex-basis: 500px;
flex-grow: 0;
}
</style>
</html>
``` ggnb!{:4_94:} 公子琛 发表于 2022-11-23 23:47
ggnb!
哥哥牛逼~
头像好看
页:
[1]