Jump to content
  • 0

Элемент с height: 100% и шестой осел.


IceFire
 Share

Question

Здравствуйте. Имеем код:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<TITLE>Что-то</TITLE>

<style type="text/css">
html,body
{
height:100%;
width:100%;
margin:0px;
padding:0px;
}

table
{
height:100%;
margin:0px;
padding:0px;
border-collapse: collapse;
border-spacing: 0px;
}
tr
{
margin:0px;
padding:0px;
}
</style>

</HEAD>

<BODY>
<table width="100%" cellpadding="0" cellspacing="0">
<tr style="height: 100%;">
<td style="height: 100%;">

<iframe width="100%" style="border: 0px; height: 100%;" src="unit.php?unit=1&diff=A" scrolling="auto"></iframe>

</td>
</tr>

<tr style="height: 20px;">
<td style="height: 20px;">

<iframe width="100%" style="border: 0px; height: 20px;" src="info_desk.php?unit=1" scrolling="no"></iframe>

</td>
</tr>
</table>

</BODY>
</HTML>

И все хорошо и в ФФ, и в Опере. А вот осел растягивает верхний фрейм (тот, у к-рого height: 100%) на ВСЮ видимую область экрана, а второй фрейм отображает за пределами видимости.

Мне бы хотелось, чтобы нижний 20-пиксельный фрейм болтался всегда у нижней границы экрана, а верхний тянулся бы.

Где я накосячил?

Буду оч признателен.

Проще говоря, вопрос сводится к следующему: почему при указании двух строк у таблицы, одна из которых имеет фиксированную высоту, а вторая - height: 100%, осел растягивает вторую строку на всю видимую область?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Как же ему не растягиваться, если вы указали ему высоту в 100% ? Попробуйте указать высоту обоих фреймов в процентах. Например, если высота одного 80%, то другого 20%ъ

ЗЫ. И код бы вам немного оптимизировать)

Link to comment
Share on other sites

  • 0

Да код оптимизирую, не вопрос. Это ж просто так - для экспериментов.

Фишка-то вся в том, что мне нужен нижний фрейм высотой именно (!) 20px, мне не нужно, чтобы он тянулся, он должен быть жестким. А вот верхний - должен тянуться. Все работает так, как мне надо, в ФФ и о Опере. ИА косячит (

Кстати, щаз заметил, этот глюк имеет место для любых таблиц, у эл-тов которых написано height: 100%.

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