CSS Chrome developer tool use inactive checkbox as CSS?
Hello,
I would like to change my WordPress website with CSS. How can I insert an unchecked checkbox into the Chrome developer tools?
For example, I find the design better when the margin checkbox isn't checked. Of course, if I want to add new CSS, I do it like this:
#cookie-notice .cn-button:not(.cn-button-custom) {} and then paste the code.
But how do I insert an unchecked checkbox?
Thank you for your time!
In the Inspector, right-click on the parent element in which the checkbox is to be inserted. In the opening context menu there is an option Edit HTML or the like. Select this, then you can insert the HTML code for a checkbox.
Note that this change (just as with CSS changes) is not persistent. After reloading the page, the element disappears from the DOM.
Thank you, I mean not insert the checkbox, but the smashed code, so that margin is not executed.
The developer tool is always such checkboxes that you can click or not, depending on the design changes. I want to insert a code that is not clicked. that the design remains as if the checkbox is not clicked
Thank you.
Click behind one of the CSS properties. Then you can add your own. Like all others, the new property also gets a checkbox that you can deactivate it.
now I have, was invalid property, thank you
Look again, if you do margin-Property has changed the right CSS rule. Your description sounds more like you didn’t. After all, the rule only refers to certain buttons.
Thanks, I’ve already tried this, but then the margin is zero everywhere and there is no more distance, the design looks bad. If I make the hook out in the developer console, this problem is somehow not
In the inspector, see which selector the CSS rule with the margin-Property uses (in your screenshot this would be the first line). You could find the line that needs to be adjusted later. However, I would rather choose a way of solving where you overwrite the rule with your own (new added) rule. The original code does not have to be changed.
As a overwrite rule, a selector of the same name would be sufficient:
He has the same Specificity, but if it is loaded/insert according to the original rule.
If your change would affect other elements unintentionally, you would have to formulate a selector that only affects your element. On SelfHTML explains which types of selectors exist. You can combine them with each other.
WordPress now offers different ways to edit CSS. Either via the Theme Editor, via Customizer or by editing the theme files explicitly (for this you need file access, e.g. via FTP). As a last alternative, there are still various plugins, which I really do not think is necessary. On kinsta all these paths are described in more detail.
Thank you, but I’m trying to explain it differently. If the box is activated with the code, the design looks bad if the box is not activated with the code, the design looks good, how do I show WordPress that it should use the version without clicking checkbox?
1) box enabled: margin: 0 0 0 10px; -> looks bad
2) Box deactivated (crossed code): margin: 0 0 10px; -> looks good
How do I use version 2? Thank you.