Elby und Ninja

7. Okt
2009
3

Facebook or Vista CSS 3 Border style

You probably know know Facebook. They decorate their messages and floating div with a nice black border.

The Facebook border-style

The Facebook border-style

Similar to Windows Vista Aero Glass effects this is not a narrow but rather wide border. In this article i want to show you, how this effect is accomplished an take it one step further and make it a Windows Aero Glass effect.

All we need is some CSS 3 and a PNG image for the Aero effect.

Before we start

Thus we use two CSS 3 declarations (border-radius and RGBa color) we need a Browser which supports CSS 3. In my case I’m using Firefox 3.5 and Safari 4.

The basic facebook-border style

Set up the HTML:

<div class="fancybox">
<div class="fancybox-inner">
<h1>The pure CSS 3 way </h1>
<p>In aliquet facilisis ante; sit ...</p>
</div>
</div>

And spice it with some magic CSS:


.fancybox {
border: 3mm solid rgb(33, 33, 33); /*fallback*/
border: 3mm solid rgba(33, 33, 33, 0.5); /* the translucent border */
max-width:640px;
margin:0 auto;
-moz-border-radius: 3mm;
-webkit-border-radius: 3mm;
border-radius: 3mm;
-moz-box-shadow: 2mm 2mm 6mm #000;
-webkit-box-shadow: 2mm 2mm 6mm #000;
box-shadow: 2mm 2mm 6mm #000;
}
/*-
Check that the border-width and the -webkit-border-radius are the same,
otherwise Safari renders an ugly border!
----------------------------------------------------------------------*/
.fancybox-inner {
background-color:#fff;
padding:4mm;
}

See a demo

The advanced Aero Glass CSS border-style

We use the same markup:

<div class="fancybox">
<div class="fancybox-inner">
<h1>The Vista / PNG Way</h1>
<p>In aliquet facilisis ante;  ...</p>
</div>
</div>

and only alter the css:


#fancybox {
margin:3em auto;
max-width:800px;
-moz-border-radius: 3mm;
-webkit-border-radius: 3mm;
background:url(bg.png) no-repeat bottom right; /* the background-image
 you want to use for the border */
padding:4mm;
-moz-box-shadow: 2mm 2mm 6mm #000;
-webkit-box-shadow: 2mm 2mm 6mm #000;
box-shadow: 2mm 2mm 6mm #000;
background-color: rgba(00,128,255,0.25); /* color the border */
}

.fancybox-inner {
background-color:#fff;
padding:4mm;
}

If you use an greyscale image you can alter the color of the border anytime by just changing the background-color. I set the opacity to 0.25 so it is just a nice little touch of a blue (or what color you choose).

See a demo

Weiter lesen / read more
7. Okt
2009
0

Gelber Tiger in grünem Gras

und der ist ganz schön schnell…

Weiter lesen / read more
3. Okt
2009
0

twitternde Kaffeemaschine

Jetzt ist es so weit. Die Maschinen reden mit uns: http://twitter.com/blankomat

Weiter lesen / read more
3. Okt
2009
0

nachgebesserte Fotos

Mehr solcher kleinen Meisterwerke hat instantShift zusammengestellt.

Weiter lesen / read more
15. Sep
2009
0

RetteDeineFreiheit.de – Rette deine Freiheit

RetteDeineFreiheit.de – Rette deine Freiheit.

Schade, schade….

Weiter lesen / read more
1. Sep
2009
0

Bayrischer Gebirgsschweißhund

YouTube – Bavarian Mountain Scenthound.

Ach die kleinen Hunde sind schon knuddelig… die mag man einfach! Und wenn sie groß sind, sind sie noch viel besser :)

PICT4912

Weiter lesen / read more
27. Aug
2009
0

Has IE6 Finally Reached the End of the Line? – CSS3 . Info

Has IE6 Finally Reached the End of the Line? – CSS3 . Info.

Das wäre echt mal was. Das wäre so toll, dass ich dafür nicht die passenden Worte finde.

Weiter lesen / read more
24. Jul
2009
0

Mister Furry ;)

Nice litte funny shortfilm ;)

MTV International / Mister Furry from Universal Everything on Vimeo.

Weiter lesen / read more
15. Jul
2009
0

heise online – 14.07.09 – YouTube stellt Unterstützung für Internet Explorer 6 ein

heise online – 14.07.09 – YouTube stellt Unterstützung für Internet Explorer 6 ein.

Das wurde aber auch höchste Zeit!!!

Weiter lesen / read more
6. Jun
2009
0

sleep timer

Ach was. Da betrachtet man dich selbst als technikaffien Menschen und lernt dann doch noch neue Funktionen kennen: den sleep timer am TV-Gerät.

Das schlimme daran ist eigentlich, dass die Funktion wohl auch rege genutzt wird…

Weiter lesen / read more