首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >html增长Hover

html增长Hover
EN

Stack Overflow用户
提问于 2017-10-02 03:51:39
回答 1查看 397关注 0票数 0

当鼠标在上面的时候,我想让每个盒子变大。到目前为止,我已经想出了这个,但它不起作用。这是我的html代码

代码语言:javascript
复制
        <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代码。我只包括了我认为与这个问题有关的那些问题。

代码语言:javascript
复制
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);
}

就像这样

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-10-02 04:34:24

必须将grow 添加到<li>中,因为它不能在锚标记上工作,只需使用这个选择器.grow:hover即可。

代码语言:javascript
复制
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);
}
代码语言:javascript
复制
<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>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46519266

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档