Skip to content

Instantly share code, notes, and snippets.

@byronrode
Created April 10, 2013 07:48
Show Gist options
  • Save byronrode/5352634 to your computer and use it in GitHub Desktop.
Save byronrode/5352634 to your computer and use it in GitHub Desktop.
How to overwrite CSS in a child theme or custom CSS file. Here I want to change the background colour and colour of an element with the class of "my_cool_css_class".
/* Parent CSS file*/
.my_cool_css_class {background:#fff;border-radius:5px;box-shadow:1px 1px 2px #000;color:#ff2361;padding:0px 10px;line-height:25px;height:25px;width:100%;}
/* This is WRONG. Very WRONG. */
/* Child Theme or Custom CSS file */
.my_cool_css_class {background:#2d2d2d;border-radius:5px;box-shadow:1px 1px 2px #000;color:#fff;padding:0px 10px;line-height:25px;height:25px;width:100%;}
/* This is RIGHT. Very RIGHT. */
/* Child Theme or Custom CSS file */
.my_cool_css_class {background:#2d2d2d;color:#fff;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment