Created
July 3, 2023 04:59
-
-
Save sandikodev/f0776ae8ef440ba76af0a1f26829aec2 to your computer and use it in GitHub Desktop.
css2 cheatsheet
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
## SELECTOR | |
### CSS2 | |
/* Child Selector */ | |
div > p { | |
color: red; | |
} | |
/* Adjacent Sibling Selector */ | |
h1 + p { | |
margin-top: 20px; | |
} | |
/* Attribute Selector */ | |
input[type="text"] { | |
width: 200px; | |
} | |
### CSS3 | |
/* General Sibling Combinator */ | |
h1 ~ p { | |
font-size: 1.2em; | |
} | |
/* :not() Pseudo-class */ | |
div:not(.highlighted) { | |
opacity: 0.5; | |
} | |
/* Attribute Selectors */ | |
a[href*="google"] { | |
background: url(/images/google-icon.png) no-repeat; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment