HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 17th, 2000, 08:42 AM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,156 pieux User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 59 sec
Reputation Power: 9
I've been looking all over for help on this, and also tried O'Reilly's DHTML book for reference, but I can't seem to figure it out.

I basically have two DIVs, of different height & width, that are side by side. The one on the left is the smaller of the two, and will always have the same content (never changing in size). The one on the right, however, contains content that changes daily, and consequently needs to have a dynamic size.

What I want to do is get the position of the bottom margin of the one on the left to change relative to the one on the right, so that the bottoms always line up (the left, top, and right margins of both DIVs have fixed positions -- only the bottom changes). Maybe I can't see the forest for the trees, but for the life of me, I can't figure it out.

Reply With Quote
  #2  
Old August 17th, 2000, 09:31 PM
JKB JKB is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Roseburg, OR, USA
Posts: 23 JKB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try placing both DIVs in a parent DIV and then position them both relative to the bottom of the parent DIV.. that should work...

or try placing your static DIV inside the right DIV align it to the bottom left. I *think you can do that...

or try placing placing both DIVs in two adjacent cells of a table and valign the contents of both cells to "bottom"...


One of the three should work I hope

Reply With Quote
  #3  
Old August 20th, 2000, 03:24 AM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,156 pieux User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 59 sec
Reputation Power: 9
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by JKB:
try placing both DIVs in a parent DIV and then position them both relative to the bottom of the parent DIV.. that should work...
[/quote]

[...]

Oops... I think I wasn't clear in my original post. The content in the left-most DIV does not change in size, but the DIV would change in size, depending on the size of the right DIV. The goal is to have the tops of the two DIVs always show up at the same position, and have the bottoms of the two DIVs line up. If the content of the right DIV is large, then the left DIV would have blank space after its content, before the bottom margin.

Reply With Quote
  #4  
Old August 20th, 2000, 03:36 PM
JKB JKB is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Roseburg, OR, USA
Posts: 23 JKB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I think I got you now.. do you have to use DIVs? I am guessing that this can be accomplished by making a table and having two adjacent cells with the DIVs in them if necessary. With adjacent cells in a table as you probably know, they both have to be the same height unless you use colspan. From there, you can specify the content of the cell on the left to stick to the top with valign="top" while the content of the right cell can run on forever if need be all the while stretching the size of the left cell along with it.

If you have to use DIVs wrap the contents of the cells in a DIV. With styles however, you can do just about the same things with a table cell (TD) tag as with a DIV and it would also be more compatible with older versions of Netscape as they dont recognize the DIV tag.

Hope this helps

Reply With Quote
  #5  
Old August 23rd, 2000, 08:30 AM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,156 pieux User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 59 sec
Reputation Power: 9
I do need to use DIVs for a number of reasons. Also, I'm familiar with the use of TABLEs and agree that I could easily do this with TABLEs.

However, there are several reasons I wish to avoid tables altogether. The most prominent is how long it takes for Netscape to render complex tables over a modem. Also, for some reason Netscape doesn't like mixing DIVs with TABLEs (so a combination of the two really isn't a solution). All sorts of undocumented things start happening, such as alignment occuring off the screen.

Perhaps this will help convey what I am trying to achieve. The only thing I want to change position is the bottom margin of the two boxes, and I want it to happen uniformly. I can get the alignment to happen correctly by specifying an absolute position. However, i f I simply set the DIVs to align on the bottom margin, the top margins could be in different positions. There are other graphical elements on the page that necessitate this particular configuration, so that's not really changeable either. I'm only showing you the boxes, because I'm trying to focus on the specific problem itself.

I've investigated other options and what I've come up with is that in order to accomplish this, I need to get the position the bottom margin of News and pass it to a function that positions Toolbox accordingly. However, that's where my problem lies (assuming there isn't any other solution). How do I get the those coordinates?

Initially, I posted a more generic question in case there was a built-in way of doing it that I was overlooking. I didn't want to be too specific, because then I would be potentially avoiding simpler solutions.

Also, I didn't mention it before, but I thought I should (since I'm mentioning Netscape so much). This site needs to look the same in Internet Explorer as it does in Netscape. It's just that much of what I'm doing is to try to avoid the kooky ways Netscape interprets what I'm trying to do.

Thanks for your time, BTW. I appreciate it.


[This message has been edited by pieux (edited August 23, 2000).]

Reply With Quote
  #6  
Old August 24th, 2000, 06:38 PM
merkinmuffley's Avatar
merkinmuffley merkinmuffley is offline
film at 11
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Portland, OR
Posts: 413 merkinmuffley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I have a similar question, dealing with dynamically lining up div layers.

I have a div with a small table in it. This table has several rows, each with an area which calls up one of several other div layers when the mouse rolls over it. I want to line up the top of these layers with the table cell of the first layer, and the left edge with the right edge of the first layer.

Any input would be greatly appreciated as I have no idea of how to go about doing this. My first attempt was to put all the layers in an outer layer, and to tell the other ones to have a 'relative' position, which I'm assuming (?) means relative to the mouse cursor... the behavior was not what I wanted.

Reply With Quote
  #7  
Old August 25th, 2000, 07:43 AM
pieux pieux is offline
Seņor Member
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2000
Posts: 1,156 pieux User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 59 sec
Reputation Power: 9
I have learned to avoid mixing tables with DIVs, because of the undocumented problems it causes. I would recommend converting your table to multiple DIVs. Also, you might find better cross-browser compatibility if you specify an absolute position for all the DIVs.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Lining up DIV edges dynamically


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway