Показать сообщение отдельно
Старый 27.08.2008, 15:32   #8
Fearless Goblin
Senior Member
 
Аватар для Fearless Goblin
 
Регистрация: 18.07.2006
Сообщений: 108
Отправить сообщение для Fearless Goblin с помощью ICQ Отправить сообщение для Fearless Goblin с помощью Skype™
По умолчанию

Код HTML:
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>overflow</title>
<style type="text/css">
.header {
  height: 20px;
  background-color: red;
}

.body {
 overflow: auto;
 height: 400px;
}

.footer {
  height: 20px;
  background-color: green;
}
</style>
</head>
<body> 
<div class="header">Something in the header</div>
<div class="body">
<h2>Definition</h2>

<p>The overflow property sets what happens if the content of an element overflow its area.&nbsp;</p>

<p><b>Inherited:</b>   No</p>

<hr />

<h2><b>JavaScript Syntax</b></h2>
<p>CSS properties can also be dynamically changed with a JavaScript.</p>

<p><b>Scripting Syntax:</b>  <i>object</i>.style.overflow=&quot;hidden&quot;</p>
<hr />

<h2>Example</h2>

<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
  <tr>
    <td valign="top">
      <p>p&nbsp;<br />
      {<br />
      overflow: scroll<br />
      }</p>
    </td>
  </tr>
</table>
<h2>Possible Values</h2>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
  <tr>
    <th align="left" valign="top">Value</th>
    <th align="left" valign="top">Description</th>
  </tr>
  <tr>
    <td valign="top">visible</td>
    <td valign="top">Default. The content is not clipped. It renders outside the element</td>
  </tr>
  <tr>
    <td valign="top">hidden</td>
    <td valign="top">The content is clipped, but the browser does not display a
      scroll-bar to see the rest of the content&nbsp;</td>
  </tr>
  <tr>
    <td valign="top">scroll</td>
    <td valign="top">The content is clipped, but the browser displays a
      scroll-bar to see the rest of the content</td>
  </tr>
  <tr>
    <td valign="top">auto</td>
    <td valign="top">If the content is clipped, the browser should display a
      scroll-bar to see the rest of the content</td>
  </tr>
</table>
<br />
</div> 
<div class="footer">Something in the footer</div>
</body>
</html>
Пример очень простой, но идея, думаю, понятна

Добавлено: кстати, на форуме тоже используется это же свойство. Например, в этом моём посте выложено большое количество кода, которое отображается в обычном div-е с тем же overflow.
Fearless Goblin вне форума   Ответить с цитированием