当我用CSS点击时,有没有办法改变鼠标悬停突出显示框的大小?这是我的导航栏。
如果可能的话,我想改变活动高亮显示框的大小。
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
</style>
</head>
<body>
<ul>
<li><a class="active" href="#new">New Order</a></li>
<li><a href="#search">Search Order</a></li>
</ul>
</body>
发布于 2021-05-04 03:36:20
将这行代码添加到css中,以便在单击时更改锚元素的大小。
li a:focus {
transform: scale(1.08);
}
如果您试图在悬停时更改大小,它将是:
li a:hover {
transform: scale(1.08);
}
https://stackoverflow.com/questions/67378171
复制相似问题