19 lis 2008

Centrowanie w div

<style>
div {
     height: 500px;
     width: 500px;
     text-align: center;
     color: #fff;
     text-transform: uppercase;
     background: black;
     display: table;
}
div span {
     display: table-cell;
     vertical-align: middle;
}

</style>
<!--[if lte IE 7]><style>

div span {
      display: inline-block;
}

b {
      display: inline-block;
      height: 100%;
      vertical-align: middle;
}
</style><![endif]-->
<div>
<span>Jakiś sobie tam tekst <br />łamliwy tekst :)</span>
<!--[if lte IE 7]><b></b><![endif]-->
</div>
</span>
17 cze 2008

Przezroczyste tło

#trans {
  height: 230px;
  width: 230px;
  padding: 10px;
  background: transparent url(overlay.png);
  position: relative;
}

/* IE FIX */

* html #trans {
    background-color: #000;
    back\ground-color: transparent;
    background-image: url(/blank.gif);
    filter: progid:DXImageTransform.Microsoft.
    AlphaImageLoader(src="/overlay.png",
    sizingMethod="scale");
}