我有 2 列,50% 和 50% 我想包含 Slick Slider在左边然后是消息和右边的按钮。 但我不知道如何包含 Slick Slider,请帮忙。
下面的部分是我正在修复的,它应该像上面的那样
这是我的代码:
section-events.jade:
section.events
.flex.flex--center
.col-50
.single-item
.item.item1 item 1
.item.item2 item 2
.item.item3 item 3
.item.item4 item 4
.col-50.flex.flex--center
.col-1
.desc-wrap
p.home-lead.outdented ...Current news and events...
a(href="").home-cta See All News
风格.sass:
.flex
display: flex
.flex--center
justify-content: center
.col-1
width: 320px
padding: 0 10px
box-sizing: border-box
.col-50
width: 50%
@media (max-width: 640px)
.col-1
width: 100%
.col-50
width: auto
section-events.sass
section.events
background:
image: url(../img/events-bg.jpg)
position: center
size: cover
.home-lead
color: white
.home-sections &
padding: 0
@media (max-width: 640px)
padding-bottom: 50px
.col-1
display: flex
align-items: center
@media (max-width: 640px)
display: block
.home-cta
color: white
background: #F06292
.col-50
.single-item
width: 50%
position: absolute
.item
width: 100%
height: 100%
text-align: center
line-height: 300px
color: white
font-size: 30px
.item1
background:
image: url(../img/events-bg.jpg)
position: center
size: cover
.item2
background:
image: url(../img/academics-bg.jpg)
position: center
size: cover
.item3
background:
image: url(../img/about-bg.jpg)
position: center
size: cover
.item4
background:
image: url(../img/events-bg.jpg)
position: center
size: cover
最佳答案
.col-1
width: 100%
应该是 50%
并且在其他任何地方都出现 .col-1
。
关于css - 如何在一个div中包含一个div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35787190/