Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # CSS notes 2018
- /* Pastebin.org
- Updated: 3/14/2020
- # Basic CSS
- * background-color:COLOR;
- * color:COLOR or rgb(r,g,b);
- * font:FONTNAME;
- * font-size: [150%|10px|large];
- @-moz-document domain(pastebin.com)
- - Selectors:
- htmltag.class {stuff}
- tag#id {stuff}
- tag1,tag2 {CSS} // Apply this style to tag1 OR tag2
- tag1 tag2 {CSS stuff} // This means tag1 followed by all tag2 below tag1 at any level.
- tag1>tag2 {stuff} // Select where tag2 is the immediate child of tag1.
- .class {stuff} // Select all these tags with this class
- #id {stuff} // Select all tags with this id
- a#id {CSS} // Select <a> tag with this id.
- li:first-child {stuff} // Select only first li tag.
- h2 ~ p {stuff} // Select all P tags if they are siblings of H2
- div * p {CSS} // Select P if it is a granchild of DIV
- div + p {CSS} // Select P if it's an immediate sibling to DIV
- div ~ p {CSS} // Select P element that are preceded by DIV
- - Pseudoselectors
- tag:hover {CSS}
- tag:after {content:' aftertest'} // Put ' aftertest' after all of these tags. See CSS entities.
- - Matching selectors
- tag[attribute^="text"] = select if attribute begins with text
- tag[attribute$="text"] = select if attribute ends with text
- tag[att*="text"] = select if attribute matches text anywhere in attribute
- tag:not(s) = select tag that is not 's'
- tag:nth-child(n) = select nth child of this tag
- More pseudo classes: https://developer.mozilla.org/nl/docs/Web/CSS/Voor_Beginners/Selectors
- [ATTRIBUTE~="string"] = [title~="flower"] = select where <title> contains 'flower'
- [ATTRIBUTE="string"] = select all tags where ATTRIBUTE is exactly 'string'
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement