![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all Is there a way to center (at least orizontally) a fixed size div in the browser window, so that when the window width is smaller than the div width, the div doesn't get stuck against the left limit of the window, but continues to stay centered, i.e. continues to shift to the left, BEYOND the left limit of the browser window. Does this make sense? can anybody help me? |
#3
| |||
| |||
|
|
Have you tried the min-width style? I believe that IE gets this wrong in just the way you describe. |
#4
| |||
| |||
|
|
hmm... I'd be looking for a way to do this not using a browser bug, but consistently, positively, and cross-browser. Any constructive ideas? I guess that would entail understanding why and how everything actually gets stuck to the top left of the browser window. I've thought of using P7's Snap Layer extension, and snap the Layer to a 1 pixel by 1 pixel image centered in a 100% width table... I guess that might work, but I thought there would be a simple CSS way to acheive that without javascript?... Murray *TMM* wrote: Have you tried the min-width style? I believe that IE gets this wrong in just the way you describe. |
#5
| |||
| |||
|
|
I thought you wanted the left edge of the div NOT to align to the left edge of the viewport but to extend left of that point. Is that not what you want? |
#6
| |||
| |||
|
|
you thought right, I want the left edge of the div NOT to align to the left edge of the viewport but to extend left of that point. But your first reply suggested using a bug in IE to acheive this: "Have you tried the min-width style? I believe that IE gets this wrong in just the way you describe." Is there a way to acheive this cross-browser, using CSS, and not by counting on a browser getting it wrong, but getting it right? Murray *TMM* wrote: I thought you wanted the left edge of the div NOT to align to the left edge of the viewport but to extend left of that point. Is that not what you want? |
#7
| |||
| |||
|
|
I only know how to do this using some kind of dHTML scroller effect - see the extensions for such at PVII, or Marja's site. |
#8
| |||
| |||
|
|
thanks Murray. If I think about my problem I imagine that a way to approach it could be to define the body width as 200% for example?... I guess I'll have to spend time experimenting with strange ideas like that and hope that something's going to work. I just assume that the Left limit of the browser window is a material wall-like limit only *by default*, and that specifying the appropriate CSS rule would hence overrule this "default" setting. It would be nice if someone could tell me if I'm right or if I'm wasting my time. Murray *TMM* wrote: I only know how to do this using some kind of dHTML scroller effect - see the extensions for such at PVII, or Marja's site. |
#9
| |||
| |||
|
|
You could do it with some javascript or with negative margins and percentages using css. Maybe worth a look for you to experiment with. Don't think it will fly in NN4. http://www.fourlevel.com/nimbus/divs/center_p.htm |
![]() |
| Thread Tools | |
| Display Modes | |
| |