Za pomocą generatora zrobiłem sobie taki szablon. Jednak za pomocą css za nic nie mogę go wyśrodkować.
Ustawiam margin: 0 auto; wszystko biorę w <div id="wrapper"> i nic.
Ustawiam margin: 0 auto; wszystko biorę w <div id="wrapper"> i nic.
Kod:
*{
margin:0;
padding:0;
}
div#wrapper {
width: 894px;
margin-left: auto;
margin-right: auto;
padding: 5px 5px 5px 5px;
margin: 0;
}
#block_1
{
float: left;
width: 2px;
margin-left: 567px;
background:url('/images/separator.gif') repeat center;
}
* html #block_1
{
display: inline;
}
#block_2
{
float: left;
width: 567px;
margin-left: -569px;
background-color: gray;
}
#block_3
{
float: left;
width: 305px;
}
/* Start Mac IE5 filter \*/
#block_1, #block_2, #block_3
{
padding-bottom: 32767px !important;
margin-bottom: -32767px !important;
}
@media all and (min-width: 0px) {
#block_1, #block_2, #block_3
{
padding-bottom: 0 !important;
margin-bottom: 0 !important;
}
#block_1:before, #block_2:before, #block_3:before
{
content: '[DO NOT LEAVE IT IS NOT REAL]';
display: block;
background: inherit;
padding-top: 32767px !important;
margin-bottom: -32767px !important;
height: 0;
}
}
/* End Mac IE5 filter */
/* IE Win can be a bit out - you might need to adjust
bottom value by -1px or as required */
.verticalalign
{
position: absolute;
bottom: 0;
}
#block_1 .verticalalign
{
width: 2px;
}
#block_2 .verticalalign
{
width: 567px;
}
#block_3 .verticalalign
{
width: 305px;
}
/* hack for Opera 7+ */
@media all and (min-width: 0px){
.verticalalign
{
width: 100% !important;
}
/* But Opera 9 does it right, so CSS3 hax to the max */
div[id^="container"] #block_1 .verticalalign
{
width: 2px !important;
}
div[id^="container"] #block_2 .verticalalign
{
width: 567px !important;
}
div[id^="container"] #block_3 .verticalalign
{
width: 305px !important;
}
}
/* hack for IEs of all persuasions before IE7 */
* html .verticalalign
{
width: 100% !important;
}
.verticalalign p
{
position: absolute;
bottom: 0;
right: 0;
margin: 0;
padding: 0;
background: #996666;
}
#container_extra
{
position: relative;
}
* html #container
{
position: relative;
}
#container
{
width: 874px;
overflow: hidden; /* This hides the excess padding in non-IE browsers */
}
/* we need this for IE 5.01 - otherwise the columns vanish */
* html #container_extra
{
float: right;
width: 100%;
}
/* we need this for IE 5.01 - otherwise the wrapper does not expand to the
necessary height (unless fixed, this problem becomes even more acute
weirdness as the method is enhanced */
#container
{
/* Normally a Holly-style hack height: 1% would suffice but that causes
IE 5.01 to completely collapse the wrapper - instead we float it */
float: right;
/* NB. possibly only IE 5.01 needs to get this float value - otherwise 5.5 sometimes
(I saw it happen many moons ago) makes the width of wrapper too small
the float: none with the comment is ignored by 5.01,
5.5 and above see it and carry on about their business
It's probably fine to just remove it, but it's left here
just in case that many moons ago problem rears its head again */
float/**/: none;
}
/* easy clearing */
#container:after
{
content: '[DO NOT LEAVE IT IS NOT REAL]';
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#container
{
display: inline-block;
}
/*\*/
#container
{
display: block;
}
/* end easy clearing */
#footer
{
clear: both;
}
#header, #footer
{
width: 874px;
}
/* Safari needs this - otherwise the ghost overflow, though painted
correctly obscures links and form elements that by rights should be above it.
An unintended side-effect is that it cause such elements to vanish in IE 5.01
and 5.5, hence the child selector hack */
* > #footer, * > form, * > #notes, * > .output
{
position: relative;
z-index: 1000;
}