Reply to Re: div no scroller in IE but fine in firefox

Your name:

Reply:


Posted by pbx on 01/06/07 21:39

Rik wrote:
> 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

ok, true if i set a px width on the parent element, i get a horizontal
scroller. i can understand the logic of not having a known width,
however, i sure like what firefox does when i don't want to set a
width. setting a px width is not what i want to do, because i have no
idea what to set it to... (if i set it too short and the user's window
is nice and wide, it looks stupid; on the other hand, if i set it too
wide and the user's window isn't so wide, the user's browser gets an
unintended scroller.)

my content doesn't need to be inside a div, but i wasn't aware that i
could set the overflow attribute on the td. i tried it and it didn't
work.

[Back to original 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

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