【发布时间】:2018-07-05 21:54:21
【问题描述】:
我正在尝试操作两个类: .header-grid & .lg-card-animation
一旦鼠标悬停在 .lg-card-animation 上,我正在尝试更改 .header-grid 类的属性。我确信动画可以正常工作并且链接正确。我正在尝试将.header-grid 中的grid-template-columns 属性更改为55% 45%。我正在使用 SASS 预处理器。如果有什么不同,我也在使用 Vuejs。
特别是不要重复我想问的是:是否可以从在兄弟类中声明的动画影响父类。
SASS:
.header-grid
height: 100vh
display: grid
grid-template-columns: 50% 50%
.lg-card-animation:hover
animation-name: expand-card
animation-duration: 1000ms
@keyframes expand-card
100%
grid-template-columns: 55% 45%
HTML:
<header class="header-grid">
<div class="full-height full-width background-fix lg-card-animation" v-bind:style="{ 'background-image': 'url(' + headerImages[0].image + ')' }">
<h1 class="header-text">{{ headerImages[0].name }}</h1>
</div>
<div class="header-row-grid">
<div class="full-height full-width background-fix" v-bind:style="{ 'background-image': 'url(' + headerImages[1].image + ')' }">
<h1 class="header-text">{{ headerImages[1].name }}</h1>
</div>
<div class="full-height full-width background-fix" v-bind:style="{ 'background-image': 'url(' + headerImages[2].image + ')' }">
<h1 class="header-text">{{ headerImages[2].name }}</h1>
</div>
</div>
</header>
【问题讨论】:
-
请包含您编译的 CSS,除非您特别遇到 Sass 语法问题。此外,这将取决于您的 HTML,因此也请包括在内。请参阅minimal reproducible example 了解更多信息。
-
也分享您的 html 部分...
-
不,我的 SASS 语法没有问题。
-
好的,我会编辑帖子。
-
已编辑帖子...
标签: css animation sass css-grid