我正在尝试使用CSS创建一个响应性的全宽度向下V形符号,如在this jsfiddle中 - 在Wordpress Visual Composer中。
当我调整浏览器窗口的大小时,V形符号会从页面like this上掉落,并且不会在容器(example)中居中。
我认为.vc-row
需要扩展到浏览器的全宽,但我尝试的任何内容似乎都无效(将宽度设置为100vw
,margin
和{{1使用padding
等到0
。
以下是代码:
HTML
!important
CSS(Sass)
<div class="vc-row-container container parent--.chevron-white">
<div class="vc_row wpb_row vc_row-fluid chevron-white vc_custom_1525861624597 vc_row-has-fill">...
需要注意的其他事项:
我正在使用Kalium WordPress主题。
.chevron-black, .chevron-white
box-sizing: content-box !important
display: block
height: 0px
left: 0 !important
margin: 0px auto 0 auto
padding: 0px !important
position: relative
text-align: center
transform: translate(0%, -100%)
width: 100% !important
z-index: 999
.wpb_column
width: 100% !important
&:after
border-style: solid
border-width: 50px 50px 0 50px
bottom: -50px
content: ""
height: 0
left: 0
margin: 0px auto 0 auto
position: absolute !important
width: 0
.chevron-black:after
border-color: $black transparent transparent transparent
.chevron-white:after
border-color: $white transparent transparent transparent
.parent--.chevron-black, .parent--.chevron-white
margin: 0 !important
padding: 0 !important
width: 100vw !important
(可视化编辑器包装器)是浏览器的全宽,.vc-container
略小,.vc-row-container
稍微少一点。由于我在Visual Composer中使用Wordpress主题,我无法直接编辑HTML,但我可以尝试覆盖JS和CSS。