Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Web программирование > HTML и CSS
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 03.06.2008, 12:05   #1
mapkyxa
Новичок
Джуниор
 
Регистрация: 03.06.2008
Сообщений: 1
По умолчанию scrolling в div

Подскажите плз как задать параметры отображения scrollbar в диве, конкретно в браузере Opera, а лучше уникально для всех браузеров. в IE все работает, а в опере отказывается((
mapkyxa вне форума Ответить с цитированием
Старый 03.06.2008, 15:42   #2
Johnatan
Antimoderаtoris
Участник клуба
 
Регистрация: 08.02.2008
Сообщений: 1,251
По умолчанию

http://www.w3schools.com/htmldom/pro...e_overflow.asp

Написано, что в девятой опере работает сие чудо.
98% из тысячи моих постов сделаны в профильном подфоруме. Я не накручиваю свои посты болтанием в "курилке", а ты?
Johnatan вне форума Ответить с цитированием
Старый 04.06.2008, 14:52   #3
SkyM@n
Laravel/Vue expert
Старожил Подтвердите свой е-майл
 
Аватар для SkyM@n
 
Регистрация: 08.08.2007
Сообщений: 2,832
По умолчанию

За цветные скроллы вообще надо подзатыльники давать.
Дан вам document, вот с ним и работайте.
SkyM@n вне форума Ответить с цитированием
Старый 05.06.2008, 00:18   #4
destr
 
Регистрация: 05.06.2008
Сообщений: 2
Плохо

Я делал так
Таблица
Код HTML:
<div class="tableContainer">
  <table width="100%" class="scrollTable">
    <thead class="fixedHeader">
      <th class="caption"  colspan="3">
        <b>Районы</b>
          </th>
    </thead>
    <tbody class="scrollContent">
<!-- Строки и колонки таблицы их было три, поэтому colspan="3" -->                                                                   
    </tbody>
  </table>
</div>
И вот такой вот CSS
Код:
/* Terence Ordona, portal[AT]imaputz[DOT]com         */
/* http://creativecommons.org/licenses/by-sa/2.0/    */

/* define height and width of scrollable area. Add 16px to width for scrollbar          */
div.tableContainer {
	clear: both;
	border: 1px solid #DDD;
	height: 210px;
	overflow: auto;
	width: 256px
}

/* Reset overflow value to hidden for all non-IE browsers. */
html>body div.tableContainer {
	overflow: hidden;
	width: 256px
}

/* define width of table. IE browsers only                 */
div.tableContainer table {
	float: left;
	 width: 250px
}

/* define width of table. Add 16px to width for scrollbar.           */
/* All other non-IE browsers.                                        */
html>body div.tableContainer table {
	width: 256px
    
}

/* set table header to a fixed position. WinIE 6.x only                                       */
/* In WinIE 6.x, any element with a position property set to relative and is a child of       */
/* an element that has an overflow property set, the relative value translates into fixed.    */
/* Ex: parent element DIV with a class of tableContainer has an overflow property set to auto */
thead.fixedHeader tr {
	position: relative
}

/* set THEAD element to have block level attributes. All other non-IE browsers            */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
html>body thead.fixedHeader tr {
	display: block
}

/* make the TH elements pretty */
thead.fixedHeader th {
	background: #DDDDDD;
	border-left: 1px solid #DDD;
	border-right: 1px solid #DDD;
	border-top: 1px solid #DDD;
    
	font-weight: normal;
	padding: 4px 3px;
	text-align: left;
        
}

/* make the A elements pretty. makes for nice clickable headers                */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
	color: #FFF;
	display: block;
	text-decoration: none;
	width: 100%
}

/* make the A elements pretty. makes for nice clickable headers                */
/* WARNING: swapping the background on hover may cause problems in WinIE 6.x   */
thead.fixedHeader a:hover {
	color: #FFF;
	display: block;
	text-decoration: underline;
	width: 100%
}

/* define the table content to be scrollable                                              */
/* set TBODY element to have block level attributes. All other non-IE browsers            */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* induced side effect is that child TDs no longer accept width: auto                     */
html>body tbody.scrollContent {
	display: block;
	height: 184px;
	overflow: auto;
	width: 100%
}

/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/                             */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
	background: #FFF;
/*	border-bottom: none;
	border-left: none;
	border-right: 1px solid #CCC;
	border-top: 1px solid #DDD;*/
    border: none;
	padding: 2px 3px 3px 4px
}

tbody.scrollContent tr.alternateRow td {
	background: #EEE;
	/*border-bottom: none;
	border-left: none;
	border-right: 1px solid #CCC;
	border-top: 1px solid #DDD;*/
    border: none;
	padding: 2px 3px 3px 4px
}

/* define width of TH elements: 1st, 2nd, and 3rd respectively.          */
/* Add 16px to last TH for scrollbar padding. All other non-IE browsers. */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors        */
html>body thead.fixedHeader th {
	width: 256px
}

html>body thead.fixedHeader th + th {
	width: 240px
}

html>body thead.fixedHeader th + th + th {
	width: 326px
}

/* define width of TD elements: 1st, 2nd, and 3rd respectively.          */
/* All other non-IE browsers.                                            */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors        */
html>body tbody.scrollContent td {
	width: 0px
}

html>body tbody.scrollContent td + td {
	width: 0px
}

html>body tbody.scrollContent td + td + td {
	width: 0px
}
По комментариям может найдёте оригинал, я уже не помню где взял.
destr вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск