Центриране на сайт

lameringo

Registered
Здравейте, моля да ми обясните какво трябва да променя по кода за да бъде центрирана страницата.

Код:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<meta http-equiv="Content-Language" content="bg">

<script language="JavaScript" type="text/javascript">

</script>
<style type="text/css">
a.style1:link
{
   color: #009300;
   font-weight: bold;
   text-decoration: none;
}
a.style1:visited
{
   color: #009300;
   font-weight: bold;
   text-decoration: none;
}
a.style1:active
{
   color: #009300;
   font-weight: bold;
   text-decoration: none;
}
a.style1:hover
{
   color: #D2B48C;
   font-weight: bold;
   text-decoration: none;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="wb_Image1" style="overflow:hidden;position:absolute;left:29px;top:31px;z-index:0" align="left">

<img src="images/header_01.jpeg" id="Image1" alt="" align="top" border="0" style="width:769px;height:273px;"></div>
<div id="wb_Image6" style="overflow:hidden;position:absolute;left:715px;top:290px;z-index:1" align="left">
<img src="images/font [] [].jpeg" id="Image6" alt="" align="top" border="0" style="width:83px;height:1101px;"></div>
<div id="wb_Image4" style="overflow:hidden;position:absolute;left:29px;top:290px;z-index:2" align="left">
<img src="images/font [] [].jpeg" id="Image4" alt="" align="top" border="0" style="width:83px;height:1101px;"></div>
<div id="wb_Image16" style="overflow:hidden;position:absolute;left:110px;top:1314px;z-index:3" align="left">
<img src="images/footer_bg.png" id="Image16" alt="" align="top" border="0" style="width:605px;height:76px;"></div>
<div id="wb_Text1" style="position:absolute;left:132px;top:251px;width:709px;height:32px;z-index:4;" align="left">
<font style="font-size:21px" color="#000000" face="Arial"><b><a href="./index.html" class="style1">Начало</a></b></font><font style="font-size:11px" color="#000000" face="Arial"><a href="./index.html" class="style1"> </a>    </font><font style="font-size:21px;background-color:#FFFFFF" color="#000000" face="Arial"><b><a href="./hotel.html" class="style1">Хотелът </a>   <a href="./tourism.html" class="style1">Туризъм</a>   <a href="./gallery.html" class="style1">Галерия</a>    <a href="./contact.html" class="style1">Контакти</a></b></font></div>

<div id="wb_Image2" style="overflow:hidden;position:absolute;left:314px;top:1079px;z-index:5" align="left">
<a href="javascript:popupwnd('./picture (2) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0010.png" id="Image2" alt="" align="top" border="0" style="width:180px;height:135px;"></a></div>
<div id="wb_Image3" style="overflow:hidden;position:absolute;left:118px;top:1077px;z-index:6" align="left">
<a href="javascript:popupwnd('./picture (3) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0012.png" id="Image3" alt="" align="top" border="0" style="width:180px;height:135px;"></a></div>
<div id="wb_Image5" style="overflow:hidden;position:absolute;left:121px;top:453px;z-index:7" align="left">
<a href="javascript:popupwnd('./picture (4) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0013.png" id="Image5" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image7" style="overflow:hidden;position:absolute;left:120px;top:300px;z-index:8" align="left">
<a href="javascript:popupwnd('./picture (5) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0014.png" id="Image7" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image8" style="overflow:hidden;position:absolute;left:511px;top:300px;z-index:9" align="left">
<a href="javascript:popupwnd('./picture (6) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0015.png" id="Image8" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image9" style="overflow:hidden;position:absolute;left:314px;top:453px;z-index:10" align="left">
<a href="javascript:popupwnd('./picture (7) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0016.png" id="Image9" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>
<div id="wb_Image10" style="overflow:hidden;position:absolute;left:314px;top:773px;z-index:11" align="left">
<a href="javascript:popupwnd('./picture (8) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0017.png" id="Image10" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image11" style="overflow:hidden;position:absolute;left:510px;top:1078px;z-index:12" align="left">
<a href="javascript:popupwnd('./picture (9) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0018.png" id="Image11" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image12" style="overflow:hidden;position:absolute;left:510px;top:606px;z-index:13" align="left">

<a href="javascript:popupwnd('./picture (10) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0019.png" id="Image12" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image13" style="overflow:hidden;position:absolute;left:121px;top:773px;z-index:14" align="left">
<a href="javascript:popupwnd('./picture (11) [].jpg','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0020.png" id="Image13" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image14" style="overflow:hidden;position:absolute;left:314px;top:300px;z-index:15" align="left">
<a href="javascript:popupwnd('./picture (12) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0021.png" id="Image14" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image15" style="overflow:hidden;position:absolute;left:511px;top:773px;z-index:16" align="left">
<a href="javascript:popupwnd('./picture (13) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0022.png" id="Image15" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image17" style="overflow:hidden;position:absolute;left:314px;top:606px;z-index:17" align="left">
<a href="javascript:popupwnd('./picture (14) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0023.png" id="Image17" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image18" style="overflow:hidden;position:absolute;left:122px;top:606px;z-index:18" align="left">
<a href="javascript:popupwnd('./picture (15) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0024.png" id="Image18" alt="" align="top" border="0" style="width:176px;height:132px;"></a></div>
<div id="wb_Image19" style="overflow:hidden;position:absolute;left:510px;top:453px;z-index:19" align="left">
<a href="javascript:popupwnd('./picture (16) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0025.png" id="Image19" alt="" align="top" border="0" style="width:176px;height:132px;"></a></div>
<div id="wb_Image20" style="overflow:hidden;position:absolute;left:121px;top:927px;z-index:20" align="left">
<a href="javascript:popupwnd('./picture (17) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0026.png" id="Image20" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>
<div id="wb_Image21" style="overflow:hidden;position:absolute;left:314px;top:927px;z-index:21" align="left">
<a href="javascript:popupwnd('./picture (18) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0027.png" id="Image21" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>

<div id="wb_Image22" style="overflow:hidden;position:absolute;left:510px;top:927px;z-index:22" align="left">
<a href="javascript:popupwnd('./picture (19) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0028.png" id="Image22" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>
<div id="wb_Html2" style="position:absolute;left:355px;top:1366px;width:71px;height:20px;z-index:23;" align="left">

</div>
<div id="wb_Text3" style="position:absolute;left:317px;top:1357px;width:145px;height:16px;z-index:24;" align="left">
 </div>
<div id="wb_Text2" style="position:absolute;left:121px;top:1253px;width:145px;height:21px;z-index:25;" align="left">
<font style="font-size:15px;background-color:#FFFFFF" color="#000000" face="Arial"><b><<<   <a href="./gallery2.html" class="style1">>>></a></b></font></div>
</body>
</html>
 
Код:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<meta http-equiv="Content-Language" content="bg">

<script language="JavaScript" type="text/javascript">

</script>
<style type="text/css">
a.style1:link
{
   color: #009300;
   font-weight: bold;
   text-decoration: none;
}
a.style1:visited
{
   color: #009300;
   font-weight: bold;
   text-decoration: none;
}
a.style1:active
{
   color: #009300;
   font-weight: bold;
   text-decoration: none;
}
a.style1:hover
{
   color: #D2B48C;
   font-weight: bold;
   text-decoration: none;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<div id="wb_Image1" style="overflow:hidden;position:absolute;left:29px;top:31px;z-index:0">

<img src="images/header_01.jpeg" id="Image1" alt="" align="top" border="0" style="width:769px;height:273px;"></div>
<div id="wb_Image6" style="overflow:hidden;position:absolute;left:715px;top:290px;z-index:1" align="left">
<img src="images/font [] [].jpeg" id="Image6" alt="" align="top" border="0" style="width:83px;height:1101px;"></div>
<div id="wb_Image4" style="overflow:hidden;position:absolute;left:29px;top:290px;z-index:2" align="left">
<img src="images/font [] [].jpeg" id="Image4" alt="" align="top" border="0" style="width:83px;height:1101px;"></div>
<div id="wb_Image16" style="overflow:hidden;position:absolute;left:110px;top:1314px;z-index:3" align="left">
<img src="images/footer_bg.png" id="Image16" alt="" align="top" border="0" style="width:605px;height:76px;"></div>
<div id="wb_Text1" style="position:absolute;left:132px;top:251px;width:709px;height:32px;z-index:4;" align="left">
<font style="font-size:21px" color="#000000" face="Arial"><b><a href="./index.html" class="style1">Начало</a></b></font><font style="font-size:11px" color="#000000" face="Arial"><a href="./index.html" class="style1"> </a>    </font><font style="font-size:21px;background-color:#FFFFFF" color="#000000" face="Arial"><b><a href="./hotel.html" class="style1">Хотелът </a>   <a href="./tourism.html" class="style1">Туризъм</a>   <a href="./gallery.html" class="style1">Галерия</a>    <a href="./contact.html" class="style1">Контакти</a></b></font></div>

<div id="wb_Image2" style="overflow:hidden;position:absolute;left:314px;top:1079px;z-index:5" align="left">
<a href="javascript:popupwnd('./picture (2) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0010.png" id="Image2" alt="" align="top" border="0" style="width:180px;height:135px;"></a></div>
<div id="wb_Image3" style="overflow:hidden;position:absolute;left:118px;top:1077px;z-index:6" align="left">
<a href="javascript:popupwnd('./picture (3) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0012.png" id="Image3" alt="" align="top" border="0" style="width:180px;height:135px;"></a></div>
<div id="wb_Image5" style="overflow:hidden;position:absolute;left:121px;top:453px;z-index:7" align="left">
<a href="javascript:popupwnd('./picture (4) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0013.png" id="Image5" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image7" style="overflow:hidden;position:absolute;left:120px;top:300px;z-index:8" align="left">
<a href="javascript:popupwnd('./picture (5) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0014.png" id="Image7" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image8" style="overflow:hidden;position:absolute;left:511px;top:300px;z-index:9" align="left">
<a href="javascript:popupwnd('./picture (6) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0015.png" id="Image8" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image9" style="overflow:hidden;position:absolute;left:314px;top:453px;z-index:10" align="left">
<a href="javascript:popupwnd('./picture (7) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0016.png" id="Image9" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>
<div id="wb_Image10" style="overflow:hidden;position:absolute;left:314px;top:773px;z-index:11" align="left">
<a href="javascript:popupwnd('./picture (8) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0017.png" id="Image10" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image11" style="overflow:hidden;position:absolute;left:510px;top:1078px;z-index:12" align="left">
<a href="javascript:popupwnd('./picture (9) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0018.png" id="Image11" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image12" style="overflow:hidden;position:absolute;left:510px;top:606px;z-index:13" align="left">

<a href="javascript:popupwnd('./picture (10) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0019.png" id="Image12" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image13" style="overflow:hidden;position:absolute;left:121px;top:773px;z-index:14" align="left">
<a href="javascript:popupwnd('./picture (11) [].jpg','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0020.png" id="Image13" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image14" style="overflow:hidden;position:absolute;left:314px;top:300px;z-index:15" align="left">
<a href="javascript:popupwnd('./picture (12) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0021.png" id="Image14" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image15" style="overflow:hidden;position:absolute;left:511px;top:773px;z-index:16" align="left">
<a href="javascript:popupwnd('./picture (13) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0022.png" id="Image15" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image17" style="overflow:hidden;position:absolute;left:314px;top:606px;z-index:17" align="left">
<a href="javascript:popupwnd('./picture (14) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0023.png" id="Image17" alt="" align="top" border="0" style="width:178px;height:134px;"></a></div>
<div id="wb_Image18" style="overflow:hidden;position:absolute;left:122px;top:606px;z-index:18" align="left">
<a href="javascript:popupwnd('./picture (15) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0024.png" id="Image18" alt="" align="top" border="0" style="width:176px;height:132px;"></a></div>
<div id="wb_Image19" style="overflow:hidden;position:absolute;left:510px;top:453px;z-index:19" align="left">
<a href="javascript:popupwnd('./picture (16) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0025.png" id="Image19" alt="" align="top" border="0" style="width:176px;height:132px;"></a></div>
<div id="wb_Image20" style="overflow:hidden;position:absolute;left:121px;top:927px;z-index:20" align="left">
<a href="javascript:popupwnd('./picture (17) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0026.png" id="Image20" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>
<div id="wb_Image21" style="overflow:hidden;position:absolute;left:314px;top:927px;z-index:21" align="left">
<a href="javascript:popupwnd('./picture (18) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0027.png" id="Image21" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>

<div id="wb_Image22" style="overflow:hidden;position:absolute;left:510px;top:927px;z-index:22" align="left">
<a href="javascript:popupwnd('./picture (19) [].JPG','no','no','no','no','no','no','','','600','450')" target="_self"><img src="images/img0028.png" id="Image22" alt="" align="top" border="0" style="width:177px;height:133px;"></a></div>
<div id="wb_Html2" style="position:absolute;left:355px;top:1366px;width:71px;height:20px;z-index:23;" align="left">

</div>
<div id="wb_Text3" style="position:absolute;left:317px;top:1357px;width:145px;height:16px;z-index:24;" align="left">
 </div>
<div id="wb_Text2" style="position:absolute;left:121px;top:1253px;width:145px;height:21px;z-index:25;" align="left">
<font style="font-size:15px;background-color:#FFFFFF" color="#000000" face="Arial"><b><<<   <a href="./gallery2.html" class="style1">>>></a></b></font></div>
</div>
</body>
</html>
 
Не става само с <div align="center"> </div> някъде другаде имам проблем :)

Пробвах с това
Код:
<body>

<div style="width: 1024px; margin: auto; position: relative;">

</div>

</body>

обаче под ИЕ не работи
 
redsystem каза:
Пробвай с
<body>
<center>
<div style="width: 1024px; margin: auto; position: relative;">

</div>
</center>
</body>

Ти май си с доста стари разбирания. Това е възможно най-глупавия таг. Говоря за <center>. Нека пробва да сложе в кода да стане:
Код:
<div style="width: 1024px; margin: auto; position: relative;align:center;">

Мисля, че можеше и така да стане.
 
djpatzo каза:
redsystem каза:
Пробвай с
<body>
<center>
<div style="width: 1024px; margin: auto; position: relative;">

</div>
</center>
</body>

Ти май си с доста стари разбирания. Това е възможно най-глупавия таг. Говоря за <center>. Нека пробва да сложе в кода да стане:
Код:
<div style="width: 1024px; margin: auto; position: relative;align:center;">

Мисля, че можеше и така да стане.

Не става само по горния начин с с center
 
lameringo каза:
djpatzo каза:
redsystem каза:
Пробвай с

Ти май си с доста стари разбирания. Това е възможно най-глупавия таг. Говоря за <center>. Нека пробва да сложе в кода да стане:
Код:
<div style="width: 1024px; margin: auto; position: relative;align:center;">

Мисля, че можеше и така да стане.

Не става само по горния начин с с center

Добре, а защо не пробваш да направиш главен див който центрира, а вътре да има <table> задължително ли искаш да е с div.
 
Не просто искам да центрирам страницата . Нямам претенции. Би ли ми обяснил с таблица как да стане.
 
<table align="center"></table>
Като межу <table align="center"> и </table> си разпределиш съдържанието.
Примерно искаш таблица с 2 ред и 2 колони.
Код:
<table align="center">
   <tr>
      <td></td>
   </tr>
   <tr>
      <td></td>
   </tr>
</table>

<tr> Поставя начало на ред а </tr> обособява края на реда.
<td> и </td> са съответно начален и краен таг на колоните.
Между <td></td> слагаш съдържанието. Било то текст картинки или линкове. Като може с ЦСС да зададеш примерно фон. Прочети повечко в гоогле, защото няма как да ти напиша всичко.
 
Код:
<!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>


<body>

<div style="width: 1024px; margin:0 auto;">

</div>

</body>

Слагаш тоя доктайп и не забравяй 0 на margin:0 auto;
 

Back
Горе