I’m trying to remove the margin-left on http://insightcxo.com/epicwin/
The problem is when I target the class .container
, it shifts the whole website over – I only want to target the div on the specific page.
This is the code I’m using that makes the page work but shifts the whole website over as well:
.container {
margin-left: 0;
}
Most WordPress themes (including yours) include the page ID as a
body
class name. In this case, the<body>
tag looks like the following:This means that you can target this page via:
More about WordPress’s
body_class()
function can be found in the Codex.As per the page you are linking, it seems you are using an page-id as a class in your body, so this might work:
I am not sure if I understand completely, but I think what you need to do is add an id to the div you want to target.
Here is a JSFiddle of what I mean:
https://jsfiddle.net/dT9Yk/25/
HTML:
CSS:
As you can see they all have the same class name but the middle one has an additional id tag.
Add a class to the body on that page only and then use specificity to target the container on only that page. For instance, add body class
epicwin
on that page and then useto target it.
Adding
margin-left: 0px;
to your CSS file is conflicting with the default.container
class of bootstrap.To fix your issue apply the class directly inline, it will solve your issue, like so:
You can create something like this in the stylesheet you are using:
.Container_Div { padding: 0px 0px 0px 0px;}
Add this to your HTML:
div class="Container_Div"
Try this and let me know.
You can target a div with class/id .you can target directly or with reference of parents div class/id as follow.
direct target
with reference to parent div .It will only apply style to class/id that exist in parent with specific id/class