Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
Last active August 29, 2015 14:17
Show Gist options
  • Save craigmdennis/77a0615db0f5607ff103 to your computer and use it in GitHub Desktop.
Save craigmdennis/77a0615db0f5607ff103 to your computer and use it in GitHub Desktop.
Some helpful CSS tricks
// Show pointer on labels to indicate clickability
label {
cursor: pointer;
}
// Show help cursor over abbreviations
abbr {
cursor: help;
}
// Hide empty paragraphs
// Very useful in WYSIWYG editors
p:empty {
display: none;
}
// Inherit the parent's border colour
// http://stackoverflow.com/a/24025056/394419
* {
border-color: inherit;
}
// Reset box sizing
// https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
// Colour an SVG the same as the text colour
// https://css-tricks.com/cascading-svg-fill-color/
svg {
fill: currentColor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment