This is a discussion on "multiple overlapping divs?" within the Web Page Design section. This forum, and the thread "multiple overlapping divs? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
multiple overlapping divs?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
multiple overlapping divs?
It's a crazy question, and I think I already know the answer, but I'm going to ask anyway. Is this possible?
|
|
|
|
#2
|
||||
|
||||
|
Re: multiple overlapping divs?
Nope, not possible. What were you intending to do with that code? You could place div's over each other using absolute positioning anyway...
|
|
#3
|
|||
|
|||
|
Re: multiple overlapping divs?
Picture 3 side-by-side floated divs... the center div contains text (height will vary), the left and right ones contain navigational elements. If I could control overlapping divs, I could vertically center the nav elements without resorting to a table. I think I've become obsesses with eliminating tables! :crazy:
|
|
#4
|
|||
|
|||
|
Re: multiple overlapping divs?
Just define your three divs one after the other.
Float them all left and control the width of each to suit your total layout width. Use margin to control space between divs. |
|
#5
|
|||
|
|||
|
Re: multiple overlapping divs?
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#6
|
|||
|
|||
|
Re: multiple overlapping divs?
I get how to stack divs side-by-side. I get how to use width and margins. What I'm trying to do is vertically center small nav images (arrow left and arrow right) in the left and right div - regardless of how the height of the middle div may vary.
|
|
#7
|
|||
|
|||
|
Re: multiple overlapping divs?
background: url("foo.jpg") left center no-repeat; no? that will keep the background centered in a div regardless of its height.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#8
|
|||
|
|||
|
Re: multiple overlapping divs?
Quote:
I can't link using a background image, though, can I? I'll still need a foreground element to serve as link/the nav element. Can I put a clear.gif in the foreground and set its height and width to 100% and have it be the clickable link/nav element? I haven't had great success in the past with setting elements to 100% height and actually have them obey (especially from a cross-browser standpoint.) If you can tell me how to do that, I'll be thrilled! |
|
#9
|
||||
|
||||
|
Re: multiple overlapping divs?
|
|
#10
|
|||
|
|||
|
Re: multiple overlapping divs?
But you're specifying a height for the anchor... The whole point is that the height will vary. Sometimes 200px will be too much, other times not enough.
I don't understand your point about hiding the text. Unless we're getting back to the whole "never ever use images for navigation" thing. But this is just a simple previous/next arrow thing - and I'll be using alt and title text, so why not just use a clear gif as the anchor? Hey, wait a minute - what about setting the height of the image to something ridiculously high, then setting overflow on the container to hidden? |
|
#11
|
|||
|
|||
|
Re: multiple overlapping divs?
Quote:
|
|
#12
|
|||
|
|||
|
Re: multiple overlapping divs?
OK. Could someone please just say, "Give it up, Donny! The only way to do that currently is using a table!"
|
|
#13
|
||||
|
||||
|
Re: multiple overlapping divs?
Can you show me what you're doing with a table? I'll tell you how to do it with CSS.
|
|
#14
|
|||
|
|||
|
Re: multiple overlapping divs?
Happy to. Here's a link: http://stickpuppy.com/dhs57/yearinre...?event=1010601
Notice the event text. Click the next arrow 4 or 5 times (you could click the previous arrow, but those images won't be preloaded for you) and watch how the event text changes in quantity, ergo height. But the next and previous arrows stay vertically centered, regardless of the height of the middle (text) div. If you must view source, know that I have overhauled most of this page and eliminated tables everywhere but in the area in question. If I need to use a single row table to do this, so be it, but I thought that since it was a single row table, I should be able to replace it with a div-based layout. |
|
#15
|
||||
|
||||
|
Re: multiple overlapping divs?
Sorry for taking so long. I forgot about this...
This was kind of tricky Last edited by Ryan Fait; Apr 23rd, 2007 at 03:54. |
|
#16
|
|||
|
|||
|
Re: multiple overlapping divs?
You cheated! I don't want to use javascript. (Sorry, should've specified.)
|
|
#17
|
|||
|
|||
|
Re: multiple overlapping divs?
Quote:
|
|
#18
|
||||
|
||||
|
Re: multiple overlapping divs?
There's no JavaScript. It's just my test page layout. Ignore the script tags.
|
|
#19
|
|||
|
|||
|
Re: multiple |