Skip to content

Instantly share code, notes, and snippets.

View Lego2012's full-sized avatar

Leo Merkel Lego2012

View GitHub Profile
a[href],
input[type='submit'],
input[type='image'],
label[for],
select,
button,
.pointer {
cursor: pointer;
}
@Lego2012
Lego2012 / hardboiled-css3-media-queries.css
Created September 26, 2016 20:37
Hardboiled CSS3 Media Queries
/* 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) {
@Lego2012
Lego2012 / highlight-checked-input.css
Created September 26, 2016 20:37
Highlight Checked Input
input:checked + label{
background: yellow;
}
@Lego2012
Lego2012 / http-links-formatieren.css
Last active October 10, 2016 19:50
HTTP Links formatieren
@Lego2012
Lego2012 / ipad-orientation.html
Last active September 21, 2022 14:47
iPad Orientation
<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>
@Lego2012
Lego2012 / jedes-n-kind-auswählen.css
Created September 26, 2016 20:38
Jedes (n)te Kind auswählen
table tr:nth-child(2n) {
background-color: #999;
}
@Lego2012
Lego2012 / leere-elemente-verstecken.css
Last active October 10, 2016 19:50
Leere Elemente verstecken
p:empty {
display:none;
}
@Lego2012
Lego2012 / multiple-borders.css
Last active February 9, 2017 13:45
Multiple Borders
#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.
@Lego2012
Lego2012 / negationen-mit-not.md
Last active November 30, 2021 14:15
Negationen mit not

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;
}
@Lego2012
Lego2012 / remove-scrollbar-from-textarea-in-ie.md
Last active November 30, 2021 14:16
Remove Scrollbar from Textarea in IE

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; }