Chodzi Ci o obrazek jako tlo?
Ustawiasz sobie styl dla body:
Kod:
body{
background-color: #KOLOR;
background-image: url('obrazek/gradient.jpg');
background-repat: repeat-x;}
Ad. 2)
Kod:
<html>
<head>...</head>
<body>
<div id="Wrapper">
<div id="Cell">
Tutaj Strona
</div>
</div>
</body>
</html>
i do tego CSS:
Kod:
*{
padding: 0;
margin: 0;}
html, body{
height: 100%;}
body{
display: table;
width: 750px; <- szerokosc strony
margin: 0 auto;}
#Wrapper{
display: table-cell;
vertical-align: middle;}
#Cell{
height: XXXpx;} <-wysokosc strony
i jeszcze hacki dla IE:
Kod:
html{
overflow-y: hidden;
overflow-x: hidden;}
body{
position: relative;}
#Wrapper{
position: absolute;
top: 50%;}
#Cell{
position: relative;
top: -50%;}
Jezeli chcesz uzyc javscript to zrob cos takiego
<html xmlns="http://www.twoja strona"><head>
<script type="text/javascript">
function laduj_tlo(){
document.getElementById('obraz').style.width='100%';
document.getElementById('obraz').style.height='100%';
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
text-align: center;
}
</style></head><body>
<img src="Twoje zdjecie.jpg" id='obraz' onload=laduj_tlo()>
</body></html>
Ustawiasz sobie styl dla body:
Kod:
body{
background-color: #KOLOR;
background-image: url('obrazek/gradient.jpg');
background-repat: repeat-x;}
Ad. 2)
Kod:
<html>
<head>...</head>
<body>
<div id="Wrapper">
<div id="Cell">
Tutaj Strona
</div>
</div>
</body>
</html>
i do tego CSS:
Kod:
*{
padding: 0;
margin: 0;}
html, body{
height: 100%;}
body{
display: table;
width: 750px; <- szerokosc strony
margin: 0 auto;}
#Wrapper{
display: table-cell;
vertical-align: middle;}
#Cell{
height: XXXpx;} <-wysokosc strony
i jeszcze hacki dla IE:
Kod:
html{
overflow-y: hidden;
overflow-x: hidden;}
body{
position: relative;}
#Wrapper{
position: absolute;
top: 50%;}
#Cell{
position: relative;
top: -50%;}
Jezeli chcesz uzyc javscript to zrob cos takiego
<html xmlns="http://www.twoja strona"><head>
<script type="text/javascript">
function laduj_tlo(){
document.getElementById('obraz').style.width='100%';
document.getElementById('obraz').style.height='100%';
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
text-align: center;
}
</style></head><body>
<img src="Twoje zdjecie.jpg" id='obraz' onload=laduj_tlo()>
</body></html>