当鼠标在上面的时候,我想让每个盒子变大。到目前为止,我已经想出了这个,但它不起作用。这是我的html代码
<div class="whole">
<div class="type">
<p>Assets</p>
</div>
<div class="plan">
<div class="content">
<ul>
<li><a href="" id="grow" onClick=window.open("Vehicles.php","Ratting","width=800,height=400,left=150,top=200,toolbar=0,status=0,scrollbars=yes,");>Vehicles</a></li>
<ol><a href="">Materials</a></ol>
</ul>
</div>
</div>
</div>这是我的css代码。我只包括了我认为与这个问题有关的那些问题。
ul{
list-style: none;
font-size: 15px;
font-family:'Open Sans';
color: #9095aa;
padding: 0px;
margin: 0px;
}
li{
border-bottom: 1px solid #494a5a;
padding: 0px;
margin: 0px;
text-align: center;
height: 52px;
line-height: 52px;
}
ol{
/*border-bottom: 1px solid #494a5a;*/
padding: 0px;
margin: 0px;
text-align: center;
height: 52px;
line-height: 52px;
}
a{
font-size: 18px;
font-family:'Open Sans';
color: white;
text-decoration: none;
}
p{
font-family:'Open Sans';
font-weight: 590;
font-size: 2.5vw;
color: black;
text-align: center;
padding-top: 10px;
}
#grow{}
a.grow:hover
{
-webkit-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3);
}就像这样

发布于 2017-10-02 04:34:24
必须将grow 类添加到<li>中,因为它不能在锚标记上工作,只需使用这个选择器.grow:hover即可。
ul {
list-style: none;
font-size: 15px;
font-family: 'Open Sans';
color: #9095aa;
padding: 0px;
margin: 0px;
}
li {
border-bottom: 1px solid #494a5a;
padding: 0px;
margin: 0px;
text-align: center;
height: 52px;
line-height: 52px;
}
ol {
/*border-bottom: 1px solid #494a5a;*/
padding: 0px;
margin: 0px;
text-align: center;
height: 52px;
line-height: 52px;
}
a {
font-size: 18px;
font-family: 'Open Sans';
/*color: white;*/
text-decoration: none;
}
p {
font-family: 'Open Sans';
font-weight: 590;
font-size: 2.5vw;
color: black;
text-align: center;
padding-top: 10px;
}
.grow:hover {
-webkit-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3);
}<div class="whole">
<div class="type">
<p>Assets</p>
</div>
<div class="plan">
<div class="content">
<ul>
<li class="grow"><a href="" onClick=window.open( "Vehicles.php", "Ratting", "width=800,height=400,left=150,top=200,toolbar=0,status=0,scrollbars=yes,");>Vehicles</a></li>
<ol class="grow"><a href="">Materials</a></ol>
</ul>
</div>
</div>
</div>
https://stackoverflow.com/questions/46519266
复制相似问题