如何解决Magento 2 Porto家用滑块设置为全宽
我正在使用具有Porto主题this demo的magento 2 正如您在链接中看到的那样,主页滑块未设置为100%宽度。我尝试了以下代码来显示全宽,但仍然在两边都显示出空白。请帮我配置一下。在此花费了超过两天的时间。无法解决。谢谢
这是我完整的CSS
<style type="text/css">
.page-main {
max-width: 100%;
padding: 0;
}
.columns .column.main {
padding: 0;
}
#banner-slider-demo-23 {
background-color: #e2e2e0;
}
#banner-slider-demo-23 .slide-content h2 {
font-family: "Nanum Brush Script";
font-weight: 400;
color: #c59b9c !important;
font-size: 68px;
line-height: 40px;
margin: 0;
margin-bottom: 16px;
}
#banner-slider-demo-23 .slide-content a > i:first-child:before {
content: '';
display: block;
border-top: 1px solid #666;
position: absolute;
left: 0;
right: 0;
bottom: -3px;
}
#banner-slider-demo-23 .slide-content a > i:first-child {
position: relative;
}
#banner-slider-demo-23 .slide-content a {
font-size: 22px;
color: #666;
text-decoration: none;
display: inline-block;
}
#banner-slider-demo-23 .slide-content a > i.porto-icon-right-open-big {
font-size: 15px;
display: inline-block;
vertical-align: middle;
margin-left: 5px;
}
#banner-slider-demo-23 .container {
position: relative;
}
#banner-slider-demo-23 .slide-content {
position: absolute;
left: 20px;
top: 50%;
transform: translateY(-50%);
}
.custom-font1 {
font-family: "Nanum Brush Script";
font-weight: 400;
}
.home-banner1 .porto-ibanner-desc h3 {
margin: 0;
line-height: .8;
font-size: 41px;
color: #222529;
text-transform: uppercase;
letter-spacing: -1px;
}
.home-banner3 .porto-ibanner-desc h2 {
font-weight: 700;
}
.porto-ibanner .porto-ibanner-content h4 {
text-transform: uppercase;
line-height: 1;
font-size: 30px;
margin: 0;
letter-spacing: -0.75px;
margin-bottom: 24px;
color: #222529;
}
.porto-ibanner .porto-ibanner-content a {
font-size: 14px;
color: #666;
text-decoration: none;
}
.home-banner1 .porto-ibanner-content a {
font-size: 17px;
}
.home-banner6 .porto-ibanner-content a {
font-size: 20px;
}
.porto-ibanner .porto-ibanner-content a i:first-child {
display: inline-block;
border-bottom: 1px solid;
line-height: 1.4;
}
.porto-ibanner .porto-ibanner-content a i.porto-icon-right-open-big {
font-size: 12px;
margin-left: 6px;
}
.home-banner3 .porto-ibanner-desc h2 {
font-weight: 700;
}
.porto-ibanner-desc h2 {
font-size: 20px;
font-family: inherit;
font-weight: 600;
letter-spacing: -0.5px;
}
.porto-ibanner .porto-ibanner-desc {
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
padding: 13% 15px;
}
.home-banner1 .porto-ibanner-desc {
align-items: flex-end;
justify-content: center;
text-align: justify;
padding-right: 9%;
}
.home-banner2 .porto-ibanner-desc {
justify-content: flex-end;
}
.home-banner4 .porto-ibanner-desc {
justify-content: flex-start;
}
.home-banner6 .porto-ibanner-title {
font-size: 30px;
font-weight: 700;
}
.homepage-bar {
border: 0;
background-color: transparent;
margin-bottom: 40px;
}
.shop-by-cat-item {
margin: 0;
position: relative;
}
.shop-by-cat-item .cat-detail {
position: absolute;
left: 25%;
right: 25%;
text-align: center;
bottom: 0;
padding: 30px 0;
background-color: #fff;
z-index: 2;
}
.shop-by-cat-item .cat-detail h3 {
margin: 0;
letter-spacing: 5.25px;
color: #222529;
}
.shop-by-cat-item:before {
content: '';
display: block;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: #000;
z-index: 1;
visibility: hidden;
opacity: 0;
transition: all .3s;
}
.shop-by-cat-item:hover:before {
visibility: visible;
opacity: .1;
}
#category-slider-demo-23 .owl-controls {
margin: 0;
}
.brands-slider .owl-carousel .owl-item img {
margin: 0 auto;
}
.homepage-bar .col-lg-4 {
padding-top: 10px;
padding-bottom: 10px;
}
.homepage-bar h3 {
font-weight: 600;
font-size: 14px;
line-height: 22px;
color: #222529;
margin: 0 0 3px;
}
.homepage-bar p {
font-weight: 300;
font-size: 13px;
line-height: 18px;
color: #839199;
letter-spacing: 0.2px;
}
.homepage-bar i {
margin-top: 2px;
line-height: 1;
}
</style>
这是我的代码
<div id="banner-slider-demo-23" class="owl-carousel owl-banner-carousel owl-middle-narrow ">
<div class="item">
<div class=""><img class="owl-lazy" alt="" data-src="{{media url="wysiwyg/srikrishna/home_slider/slider-2.jpg"}}"></div>
</div>
<div class="item">
<div class=""><img class="owl-lazy" alt="" data-src="{{media url="wysiwyg/srikrishna/home_slider/slider-1.jpg"}}"></div>
</div>
<div class="item">
<iframe width="100%" height="480" src="https://www.youtube.com/embed/F2KSdfmLVLU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<script type="text/javascript">
require([
'jquery','owl.carousel/owl.carousel.min'
],function ($) {
var banner_owl = $("#banner-slider-demo-23");
banner_owl.owlCarousel({
items: 1,autoplay: true,autoplayTimeout: 5000,autoplayHoverPause: true,dots: false,nav: true,navRewind: true,animateIn: 'fadeIn',animateOut: 'fadeOut',loop: true,lazyLoad: true,navText: ["<em class='porto-icon-left-open-big'></em>","<em class='porto-icon-right-open-big'></em>"]
});
});
</script>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。