简体   繁体   English

全屏宽度 <div> 左边距

[英]Full width <div> with margin-left

I am building a website with Wordpress and Visual Composer (site builder). 我正在使用Wordpress和Visual Composer(网站构建器)构建网站。 I want to make a menu on the right (red). 我想在右边做一个菜单(红色)。 It has 250px width . 250px width Visual Composer has an option: "Full width, scratch content". Visual Composer有一个选项:“全宽,暂存内容”。 It is enabled in green the <div> . <div>以绿色启用。 But it works in a strange way. 但是它以一种奇怪的方式工作。 It is dynamicly setting width and the left value. 它是动态设置宽度和left值。 I set width with calc and it works. 我用calc设置宽度,它可以工作。 Also when I set margin-left to 250px in Developer Tools in Chrome it works. 另外,当我在Chrome的开发人员工具中将margin-left设置为250px ,它也可以工作。 But I added a class .nowa in Jquery and set margin-left there and it does not work. 但是我在Jquery中添加了一个类.nowa ,并在那里设置margin-left ,这是行不通的。 Because the left value takes into account that it is 250px . 因为left值考虑到它是250px Here is link: manx.bdl.pl/dworek 这是链接: manx.bdl.pl/dworek

I just want to move the green <div> 250px to the right... 我只想将绿色<div> 250px移到右边...

use important to override the previous classes like this margin-left: 0px !important; 使用Important可以覆盖以前的类,例如margin-left: 0px !important; and left:0px !important; 左:0px!重要; to vc_ row-fluid class 到vc_ row-fluid

.vc_row-fluid
{
margin-left: 0px !important;
left: 0px !important;
}

在此处输入图片说明

Just add padding-left: 250px; 只需添加padding-left: 250px; to the green div. 到绿色区。 That should work 那应该工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM