[英]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
移到右边...
Just add padding-left: 250px;
只需添加padding-left: 250px;
to the green div. 到绿色区。 That should work 那应该工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.