Код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//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=windows-1251" />
<title>Задача</title>
<meta name="description" content="html, css" />
<meta name="keywords" content="html, css, web design" />
<meta name="robots" content="index, follow" />
<link type="text/css" rel="stylesheet" href="css/zada4a.css" />
</head>
<body>
<div id="header">
<ul>
<li><a href="#">Menu 1</a></li>
<li><a href="#">Menu 2</a></li>
<li><a href="#">Menu 3</a></li>
<li><a href="#">Menu 4</a></li>
<li><a href="#">Menu 5</a></li>
</ul>
</div>
<table cellpadding="0"; cellspacing="0" align="left" width="170px">
<tr>
<td class="links"><a href="#">Link 1</a></td>
</tr>
<tr>
<td class="links"><a href="#">Link 2</a></td>
</tr>
<tr>
<td class="links"><a href="#">Link 3</a></td>
</tr>
<tr>
<td class="links" ><a href="#">Link 4</a></td>
</tr>
<tr>
<td class="links"><a href="#">Link 5</a></td>
</tr>
<tr>
<td class="links"><a href="#">link 6</a></td>
</tr>
<tr>
<td class="links"><a href="#">Link 7</a></td>
</tr>
<tr>
<td class="links"><a href="#">Link 8</a></td>
</tr>
</table>
<div id ="cont">
</div>
<div id="footer">
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
<li><a href="#">Link 5</a></li>
</ul>
</div>
</body>
</html>
CSS
Код:
html, body {position: relative; height: 100%; background: #ccc; color: #000; font-size: 18px; font-family: georgia,verdana, sens-serif; margin: 0px; padding: 0px;}
#header {line-height: 56px; height: 56px; width: auto; margin: 0 auto; padding: 0 0 0 0; background-color: green;}
#header ul {margin: 0 0 0 450px; padding:0 0 0 0; list-style-type: none;}
#header ul li{margin: 18px 20px 0 0; padding: 0; list-style-type: none; display: inline; font-size: 20px; font-family: arial; font-weight: bold;}
#header ul li a {color: #fff; text-decoration: none;}
#header ul li a:hover {color: #fff; text-decoration: underline;}
#header ul li a:active {color: #cac2c2;}
.links{padding:0px;margin:0px;}
.links a{padding: 5px 0 0px 5px; line-height: 13px; text-decoration: none; font-family: georgia; font-size: 15px; font-weight: normal; color: #e0427d; background-color:#ccff99; display:block; height:22px; border: 1px solid #999900;}
.links a:hover {background-color:#ffcc66;}
.links a:visited {color: #e0427d;}
#cont {background: url(../img/DSC00193.jpg) no-repeat; width: 640px; height: 480px; margin: 0 0 0 170px;}
#footer {line-height: 38px; padding: 0 0 0 0; background: #999900; margin: 536px 0 0 0; height: 38px; width: 100%; position: absolute; bottom:0;}
#footer ul {margin: 0 0 0 500px; padding:0 0 0 0; list-style-type: none;}
#footer ul li{margin: 18px 20px 0 0; padding: 0; list-style-type: none; display: inline; font-size: 14px; font-family: arial; font-weight: bold;}
#footer ul li a {color: #fff; text-decoration: none;}
#footer ul li a:hover {color: #fff; text-decoration: underline;}
#footer ul li a:active {color: #cac2c2;}
Не знам дали обяснявам добре. Искам цялата страница да е центрирана хоризонтално при всякаква резолюция. Е, размерът на картинката си остава такъв. Но Таблицата, хедъра и футеа да не започват в началото и да стигат до края. Направих 2 дива в ляво и дясно - в които няма нищо и им зададох ширина в проценти - не стана. Някой по навътре в материята може ли да помогне? Значи при различна ширина на монитора, разстоянието в двата края да е различно.