Created
April 24, 2015 16:19
-
-
Save oojikoo-gist/e789d474eaad48ef5a9c to your computer and use it in GitHub Desktop.
rails: css_dictionary.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CSS dictionary | |
// <a href="#" rel="friend nofollow">Larry</a> | |
li a[rel~='friend'] { | |
font-weight: bold; | |
} | |
// target only #upperSection, #lowerSection | |
// <div id="upperSection"> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// </div> | |
// <div id="somethingElse"> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// </div> | |
// <div id="lowerSection"> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// </div> | |
// <div id="footer"> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// </div> | |
div[id*='Section'] { | |
color: red; | |
} | |
// target begin with or end with | |
// <ul> | |
// <li><a href="#" title="stooge one">Larry</a></li> | |
// <li><a href="#" title="the second stooge">Curly</a></li> | |
// <li><a href="#" title="stooge three">Moe</a></li> | |
// <li><a href="#" title="impostor">Curly-Joe</a></li> | |
// </ul> | |
li a[title^='stooge'] { | |
color: red | |
} /*Beginning*/ | |
li a[title$='stooge'] { | |
color: yellow | |
} /*Ending*/ | |
// Chaining Attribute Selectors | |
// <ul> | |
// <li><a href="#" title="stooge one">Larry</a></li> | |
// <li><a href="#" title="the second stooge">Curly</a></li> | |
// <li><a href="#" title="stooge three">Moe</a></li> | |
// <li><a href="#" title="the impostor">Curly-Joe</a></li> | |
// </ul> | |
li a[title*='stooge'][title^='the'] {color: red;} | |
// The Book of CSS3 | |
// <div id="combinators"> | |
// <p>Not this one.</p> | |
// <h1>Gibberish</h1> | |
// <p>Pick me!</p> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// <p>Lorem ipsum dolor sit amet...</p> | |
// </div> | |
h1 + p {color: orange;} | |
// all after h1 | |
h1 ~ p {color: orange;} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment