evo i ceo cod, kad je css u istom folderu sa index stranicim radi primer
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<title>Proba</title>
</head>
<body id="body">
<div id="site"></div>
</body>
</html>
a kad je css u drugom folderu nece da radi primer
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<title>Proba</title>
</head>
<body id="body">
<div id="site"></div>
</body>
</html>
css fajl
Code:
#body {
background-image:url(bg.jpg);
background-position:top;
background-repeat:repeat-x;
}
#site {
background-image:url(background.jpg);
background-position:top;
background-repeat:no-repeat;
height:1031px;
width:997px;
margin: 0 auto;
}
da ne postavljam slike sad.
Djole