Support » Themes and Templates » In child style.css remove line from parent style.css

  • Resolved wperic


    I’ve found a couple of places in theme discussions where the advice on how to change the theme included removing certain lines or parts of certain lines from the style.css.

    I take it that I can solve the ‘remove parts of certain lines’ by just including the edited line in the child style.css. (It’s not clear that this works, though. I suspect I haven’t actually deleted anything by doing this.)

    But what do I do in the child style.css to effect the removal of an entire line from the parent style.css? Best practice says I shouldn’t just go into the parent style.css and delete or comment out the lines.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    You can’t remove anything from the parent style.css within the child style.css, but you can override it.

    For example, say the parent style.css contained the following:

    #something .something-else {
    	font-weight: bold;
    	color: #f00;

    And you didn’t want the bold and red styling, you’d add the following to the child style.css:

    #something .something-else {
    	font-weight: normal;
    	color: #000;

    That would override the parent styling.


    Hi, I am in a similar situation where a styling in the parent style.css is causing havoc. So just to be sure, there is no way to remove the culprit styling in the parent style.css except to comment it out?

    Correct, but as mentioned above, you can override anything you like.

    Thanks for your help Ross.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘In child style.css remove line from parent style.css’ is closed to new replies.