首页 > 解决方案 > 在将 bg_img 隐藏到 img 时没有出现后

问题描述

在使用@media queries时,我目前正在uk-hidden@m为我的img {}班级使用,并将我的bg_img {}班级与uk-visible@m. 这就是它们的样子:

(bg_img uk-visible@m)

.bg-image {
   position: relative;
   height: ~px;
   width: ~px;
   box-shadow: 10px 11px 10px 1px rgba(0, 0, 0, 0.25);
   &::after {
       position: absolute;
       content: '';
       bottom: -46px;
       left: 0;
       height: 46px;
       width: 80%
       background-color: #DCCA7E;
       z-index: -1;
   }
   @include breakpoint(small down) {
       height: 46.72;
   }
}

(img uk-hidden@m)

img {
    &::before {
       position: absolute;
       content: '';
       bottom: -46px;
       left: 0;
       height: 46px;
       width: 80%;
       background-color: #DCCA7E;
       z-index: -1;
   }
   @include breakpoint(medium down) {
       max-width: 140%;
   }
}

&::after没有出现在媒体屏幕上之前的媒体屏幕,img{}隐藏和bg_img {}出现的大小。我想了解为什么会发生这种情况,以防止将来发生这种情况。

感谢那些花时间的人!:)

标签: css

解决方案


推荐阅读