CSS - Snippets: Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 64: | Zeile 64: | ||
=== Hübsche Selectboxen mit CSS === | === Hübsche Selectboxen mit CSS === | ||
http://www.htmllion.com/default-select-dropdown-style-just-css.html (2015-13) | http://www.htmllion.com/default-select-dropdown-style-just-css.html (2015-13) | ||
| + | |||
The HTML Markup | The HTML Markup | ||
| − | + | <pre> | |
<form class="demo"> | <form class="demo"> | ||
<select> | <select> | ||
| Zeile 83: | Zeile 84: | ||
</select> | </select> | ||
</form> | </form> | ||
| + | </pre> | ||
The CSS | The CSS | ||
| − | + | <pre> | |
<style> | <style> | ||
.demo select { | .demo select { | ||
| Zeile 106: | Zeile 108: | ||
} | } | ||
</style> | </style> | ||
| + | </pre> | ||
Version vom 12. März 2015, 14:22 Uhr
Siehe auch CSS - Baukasten (alt)
Links
htmllion.com - scheint eine gute Seite für alles mögliche zu sein
Diverse CSS Snippets
CSS - Stitched Look - aufgenäht
CSS - bildschirmfüllendes Hintergrundbild
CSS - Mehr Raum bei Anchor-Sprüngen
Fixes Seitenlayout "springt" wegen Scrollbalken
Entweder minimale Höhe definieren oder den Scrollbalken immer anzeigen:
/*not valid but works in all browsers exept Opera*/
html {
overflow-y: scroll;
}
/* only Mozilla (IE has always Scrollbars)*/
overflow: -moz-scrollbars-vertical;
Radius
Vorsicht bei Bildern. Diese werden nicht beschnitten (Stand 2011)
-webkit-border-radius: 40px; -moz-border-radius: 40px; border-radius: 40px;
Schatten
.schatten
{
box-shadow: 3px 3px 5px #888;
-webkit-box-shadow: 3px 3px 5px #888;
-moz-box-shadow: 3px 3px 5px #888;
}
Die Werte bezeichnen: Versatz in x-Richtung, y-Richtung, den Wert für das Weichzeichnen und natürlich die Schattenfarbe.
Schatten auf alten IE Mit Microsoft Filter Funktionen. Es gibt zwei unterschiedliche Schatten Filter. Beide liefern ein eher mäßiges Ergebnis.
.ie-schlagschatten
{
filter:progid:dxImageTransform.Microsoft.dropShadow(color=#8888,offX=3,offY=3 positive=true);
}
.ie-schatten
{
filter:progid:DXImageTransform.Microsoft.Shadow(color='#8888',direction='120',strength='3');
}
Formulare
Hübsche Selectboxen mit CSS
http://www.htmllion.com/default-select-dropdown-style-just-css.html (2015-13)
The HTML Markup
<form class="demo"> <select> <option>CSS</option> <option>HTML </option> <option>HTML 5</option> </select> <select class="balck"> <option>CSS</option> <option>HTML </option> <option>HTML 5</option> </select> <select class="option3"> <option>CSS</option> <option>HTML </option> <option>HTML 5</option> </select> </form>
The CSS
<style>
.demo select {
border: 0 !important; /*Removes border*/
-webkit-appearance: none; /*Removes default chrome and safari style*/
-moz-appearance: none; /* Removes Default Firefox style*/
background: #0088cc url(img/select-arrow.png) no-repeat 90% center;
width: 100px; /*Width of select dropdown to give space for arrow image*/
text-indent: 0.01px; /* Removes default arrow from firefox*/
text-overflow: ""; /*Removes default arrow from firefox*/ /*My custom style for fonts*/
color: #FFF;
border-radius: 15px;
padding: 5px;
box-shadow: inset 0 0 5px rgba(000,000,000, 0.5);
}
.demo select.balck {
background-color: #000;
}
.demo select.option3 {
border-radius: 10px 0;
}
</style>