Jump to content
  • 0

как разместить div по центру страницы


kich
 Share

Question

Собственно вопрос в теме, с IE я его решил, через хак, а вот чтоб на чистом css не получается, собственно, ниже код, из него все понятно

<!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>
<title>Документы</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
body{
width:100%;
height:100%;
margin:0;
font : 12px Verdana;
}
#container{
position: relative;
width:900px;
min-height:228px;
background-image:url(kepka.jpg);
background-repeat:no-repeat;
background-position: right top;
text-align:justify;
}
#noname{
position: relative;
margin-right:355px;
}
</style>
</head>
<body>
<center>
<!--[if lte IE 6]><table height=100% width=100%><tr><td valign=middle><![endif]-->
<div id="container">

<div id="noname">

<b style="font-size:20px;font-weight:bold;color:red">ОШИБКА [404]</b><br/>
Страница по своему юридическому адресу отсутствует

</div>
</div>
<!--[if lte IE 6]></td></tr></table><![endif]-->
</center>
</body>
</html>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

чуток твое исправил... в ie 5* не ровняет по центру... времени в обрез поэтому попробуй сам с этим справиться....

<!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>
<title>Документы</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<style>
html,body{width:100%;height:100%;margin:0;font : 12px Verdana;}
#container{
position:relative;
border:1px solid;
width:400px;
top:50%;
margin:-200px auto 0 auto;
height:400px;
min-height:228px;
background:no-repeat url(kepka.jpg) right top;
text-align:justify;

}
#noname{border:1px solid;}
#noname span{font-size:20px;font-weight:bold;color:red}

</style>
</head>
<body>


<div id="container">
<div id="noname">
<span>ОШИБКА [404]</span><br/>
Страница по своему юридическому адресу отсутствует
</div>
</div>
</body>
</html>

Edited by dber
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy