You are here: Re: div no scroller in IE but fine in firefox « HTML « IT news, forums, messages
Re: div no scroller in IE but fine in firefox

Posted by Rik on 01/06/07 21:14

pbx wrote:
> BootNic wrote:
>>> pbx <pbeisel@gmail.com> wrote:
>>> news: 1168111898.950706.47910@51g2000cwl.googlegroups.com
>>>> BootNic wrote:
>>>>> pbx <pbeisel@gmail.com> wrote:
>>>>> i have a div tag on my html page as follows:
>>>>> <div style="overflow-x:scroll;"> (or auto, makes no difference)
>>>>> the contents of the div are about 1500 pixels wide.
>> [snip]
>>>>> any workaround?
>>>>
style="width:100%;overflow:scroll;overflow-y:visible;overflow-x:scroll;"
>>>
style="width:100%;overflow:scroll;overflow-y:visible;overflow-x:scroll;"
>>> unfortunately it doesn't change anything obvious.
>>> does it matter than the contents of the div is a table?
>>
>> It would be in your best interest to make an example and provide a
>> URL. It's not likely I can guess the content that may be causing the
>> issue
>> you describe.
>
> (sorry for that top post, i don't do this often. i fear i am about to
> make mistake #2 by putting my sample code here vs. a remote server...)

Indeed, I will not test the code manually :P

> ok, here is some simple HTML that demonstates the problem. copy and
> paste into a text file and then open with IE 7 and then Firefox.
>
> the first div, byitself, scrolls as desired.
>
> the second div, enclosed in a simple table, doesn't scroll.
>
> the div contents and style attributes are identical, the second one is
> simply enclosed in a table.

A relative width (%) only works if the parent element has a known width (so
either set in px/em/% etc.). Nesting the div will result in in the
width="100%" being useless, as the width of the td is not set. Why even use
the div anyway? If you've decided to use a table-cell for markup you might
as well set the properties directly on the td itself.

In short: overflow only works when there are known dimensions, and a
percentage of an unkown width is equally unknown.
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация