Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 将SCSS/CSS悬停在图像上_Html_Css_Sass - Fatal编程技术网

Html 将SCSS/CSS悬停在图像上

Html 将SCSS/CSS悬停在图像上,html,css,sass,Html,Css,Sass,我想把鼠标悬停在一个盒子上,变换图像的比例(1.1)。但问题是我在图像前面有一个文本。因此,如果我在文本上悬停,它将不起作用 我想将鼠标悬停在盒子上的任何位置并缩放图像 这是我的密码 HTML 与其缩放图像悬停时的图像,不如缩放其父元素悬停时的图像,该父元素包括图像和文本 &--nation:hover > image { //scale to 1.1 } 编辑:您的代码如下 .club-index { &__box {

我想把鼠标悬停在一个盒子上,变换图像的比例(1.1)。但问题是我在图像前面有一个文本。因此,如果我在文本上悬停,它将不起作用

我想将鼠标悬停在盒子上的任何位置并缩放图像

这是我的密码

HTML


与其缩放图像悬停时的图像,不如缩放其父元素悬停时的图像,该父元素包括图像和文本

 &--nation:hover > image {
          //scale to 1.1
 }
编辑:您的代码如下

    .club-index {
       &__box {
           margin-top: 30px;
           &--nation {
               position: relative;
               display: block;
               width: 100%;
               height: 250px;
               margin: 0 auto;
               background-color: #18202d;
               text-align: center;
               overflow: hidden;

           }
           &--nation:hover > &--image {
                   transform: scale(1.1);
                   -moz-transform: scale(1.1);
                   -webkit-transform: scale(1.1);
                   -o-transform: scale(1.1);
               }
           &--image {
               position: absolute;
               transition: all 1s ease-in-out 0s;
               -moz-transition: all 1s ease-in-out 0s;
               -webkit-transition: all 1s ease-in-out 0s;
               -o-transition: all 1s ease-in-out 0s;
           }
 &--nation:hover > image {
          //scale to 1.1
 }
    .club-index {
       &__box {
           margin-top: 30px;
           &--nation {
               position: relative;
               display: block;
               width: 100%;
               height: 250px;
               margin: 0 auto;
               background-color: #18202d;
               text-align: center;
               overflow: hidden;

           }
           &--nation:hover > &--image {
                   transform: scale(1.1);
                   -moz-transform: scale(1.1);
                   -webkit-transform: scale(1.1);
                   -o-transform: scale(1.1);
               }
           &--image {
               position: absolute;
               transition: all 1s ease-in-out 0s;
               -moz-transition: all 1s ease-in-out 0s;
               -webkit-transition: all 1s ease-in-out 0s;
               -o-transition: all 1s ease-in-out 0s;
           }