Member Avatar for mehnihma

HI
I have this in wordpress css:

* {
  padding: 0;
  margin: 0;
}

How can I disable margin: 0; in child theme?

Thanks

Override it with this in your child theme style.css

* { margin: auto }

This will bring back the browsers' default margin of your elements.

Member Avatar for mehnihma

I have tried it, but it does not helpe.
Elements are messed up untill I remove it from main css.
But I need solution in child theme

Yeah, it's likely your layout will break if you reset it to 'auto', because like I said it will bring back the default margins that are set in the browsers.
Why do you want to remove it?

Member Avatar for mehnihma

I have an element that brakes with margin set. When I remove it it possitions normaly.
I am not sure how to fix it

Then only override the margin for that element in your child theme css.

Member Avatar for mehnihma

That is the question, how to do that

Well... that depends. Has that element a class name? And do you have in your child theme directory a style.css file where you can override the parent theme styles?

Member Avatar for mehnihma

Yes I have
and this is the element

input.wpi-button:hover, input.wpi-button:active, input.wpi-button:focus {
    background-color: #dddddd;
    background-image: none;
    border: 1px solid #cac9c9;
    padding: 5px 5px 4px;
}
button, html input[type="button"], input[type="reset"], input[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
}
input.wpi-button {
    background-color: #eeeeee;
    background-image: none;
    border: 1px solid #cac9c9;
    border-radius: 4px;
    box-shadow: none;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.42857;
    padding: 5px 5px 4px;
    text-shadow: none;
}

Well if it is input.wpi-button then just set the margin you want on it in your child theme style.css. And as far as I know is the default margin of input elements already '0', so I'm not sure what you want to do with it.

Member Avatar for mehnihma

remove it somehow
because while I have it , it does not show correctly :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.