Sollen alle Elemente – bis auf p-Tags – ausgewählt werden? Kein Problem mit der Negationen :not(). In unserem Beispiel werden alle DOM-Elemente ausgewählt, die kein p-Tag sind und mit der Schriftfarbe weiß formatiert.
:not(p) {
color: #fff;
}
| a[href], | |
| input[type='submit'], | |
| input[type='image'], | |
| label[for], | |
| select, | |
| button, | |
| .pointer { | |
| cursor: pointer; | |
| } |
| /* Smartphones (portrait and landscape) ----------- */ | |
| @media only screen | |
| and (min-device-width : 320px) | |
| and (max-device-width : 480px) { | |
| /* Styles */ | |
| } | |
| /* Smartphones (landscape) ----------- */ | |
| @media only screen | |
| and (min-width : 321px) { |
| input:checked + label{ | |
| background: yellow; | |
| } |
| a[href^="https://"] { | |
| color: #0f0; | |
| } |
| <style> | |
| @media only screen and (max-device-width: 1024px) and (orientation:portrait) { | |
| .landscape { display: none; } | |
| } | |
| @media only screen and (max-device-width: 1024px) and (orientation:landscape) { | |
| .portrait { display: none; } | |
| } | |
| </style> | |
| <h1 class="portrait">Your device orientation is "portrait"<h1> |
| table tr:nth-child(2n) { | |
| background-color: #999; | |
| } |
| p:empty { | |
| display:none; | |
| } |
| #borders { | |
| position:relative; | |
| z-index:1; | |
| padding:30px; | |
| border:5px solid #f00; | |
| background:#ff9600; | |
| } | |
| /* | |
| The pseudo-elements are positioned at specific distances away from the edge of the element’s box, moved behind the content layer with the negative z-index, and given the border and background values you want. |
Sollen alle Elemente – bis auf p-Tags – ausgewählt werden? Kein Problem mit der Negationen :not(). In unserem Beispiel werden alle DOM-Elemente ausgewählt, die kein p-Tag sind und mit der Schriftfarbe weiß formatiert.
:not(p) {
color: #fff;
}
It makes you wonder why do textareas have in IE a scrollbar even when they’re empty. Nobody knows for sure but here’s the solution.
textarea { overflow: auto; }