Jump to content
  • 0

Прижимание div position:absolute справа


qazibum
 Share

Question

Всем привет.

Делаю дизайн для сайта и возникла загвоздка. Правый блок надо прижать к правой стороне сайта. Подскажите как это сделать.

<div id="rightbox"> должен прижиматься к правой стороне вне зависимости от разрешения экрана. При разрешение 800х600 этот блок прижимается к правой стороне экрана, но справа еще есть часть сайта. То есть он закрывает часть <div id="content">.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="all">
<div id="top"></div>
<div id="center">
<div id="content"><br /><br /></div>
<div id="leftbox"><br /><br /></div>
<div id="rightbox"><br /><br /></div></div>
<div id="footer"></div>
</div>
</body></html>

css

body {
background: #0000FF;
height: 100%;
margin: 0;
padding: 0;
min-width: 1000px;
}
#all {
width: 95%;
margin-left: auto;
margin-right: auto;
margin-top: -10px;
}
#top {
height: 100px;
}
#leftbox{
border:1px solid #000;
padding: 0;
top: 150px;
left: 0;
width: 200px;
float: left;
position: absolute;
overflow: hidden;
}
#rightbox{
border:1px solid #000;
padding: 0;
top: 150px;
right: 0px;
width: 200px;
float: right;
position: absolute;
overflow: hidden;
}
#content{
border:1px solid #000;
padding: 0;
width: 65%;
margin: 0 0 0 190px;
}
#center{
min-height: 600px;
width: 100%;
background: #fff;
}
#footer{
height: 100px;
overflow: hidden;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

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