|
|
|
| Подскажите, пожалуйста, что я неправильно делаю. Мне нужно, чтобы div располагался на странице на определенном расстоянии слева и сверху окна. И внутри этого дива должны быть 4 дива в ряд.
У меня тот, который с отступом слева и сверху(белый див) не весь вмещается по высоте окна и не прокручивается.
Делаю так:
<body style = "background:#000;margin:0;padding:0;">
<div style = "position:absolute;left:400px;top:200px;background:#fff;display:block;width:800px;height:600px;">
<div style = "background:#f00;width:200px;height:300px;display:block;float:left;">asdfas</div>
<div style = "background:#0f0;width:200px;height:300px;display:block;float:left;">asdfas</div>
<div style = "background:#f00;width:200px;height:300px;display:block;float:left;">asdfas</div>
<div style = "background:#0f0;width:200px;height:300px;display:block;float:right;">asdfas</div>
</div>
</body>
|
| |
|
|
|
|
|
|
|
для: Лена
(17.02.2010 в 23:34)
| |
<div style="margin: 200px 0px 0px 400px; background:#fff;display:block;width:800px;height:600px;">
|
| |
|
|
|
|
|
|
|
для: Lelik
(17.02.2010 в 23:42)
| | Код немного поменялся, не все учла:
<body style = "background:#000;margin:0;padding:0;">
<div style = "position:absolute;left:400px;top:200px;background:#fff;display:block;width:820px;height:600px;">
<div style = "background:#00f;width:800px;height:350px;display:block;padding:0px 10px;">
<div style = "background:#f00;width:194px;height:300px;display:block;float:left;margin:25px 3px;">asdfas</div>
<div style = "background:#0f0;width:194px;height:300px;display:block;float:left;margin:25px 3px;">asdfas</div>
<div style = "background:#f00;width:194px;height:300px;display:block;float:left;margin:25px 3px;">asdfas</div>
<div style = "background:#0f0;width:194px;height:300px;display:block;float:right;margin:25px 3px;">asdfas</div>
</div>
</div>
</body>
|
Но так, как Вы предложили, сделала и все равно если этот див имеет высоту больше, чем высота окна, он не прокручивается. | |
|
|
|
|
|
|
|
для: Лена
(18.02.2010 в 00:01)
| | а что значит не прокручивается? | |
|
|
|
|
|
|
|
для: Лена
(18.02.2010 в 00:01)
| | чтобы прокуручивался, нужно установить overflow=auto для этого дива | |
|
|
|