Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old April 14th, 2004, 10:57 PM
DingoChopChop DingoChopChop is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 DingoChopChop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
DIV positioning

I would like to place three DIV's next to each other. When the body.width
is less than than width of the first DIV I do NOT want the next two DIV's to wrap.
How can I prevent this?

I have tried position:absolute and flow:right/left without effect.

Cheers,
Colin.

Reply With Quote
  #2  
Old April 15th, 2004, 02:33 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Hmmm... interesting problem.... have your tried setting the body width to something larger than the sum of the 3 divs? And yes, you will need to use float:left on the divs to get them on the same line, or you can use absolute positioning.

e.g.
body {
width : 2000px;
}
You will probably get hoz scroll bars though.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old April 15th, 2004, 05:50 PM
DingoChopChop DingoChopChop is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 DingoChopChop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The three DIV's are sized automatically to fill the body.width during client side onload and resize, so as to always look nice. It's cool with a wide body but the user may have a smaller window size. I require the exact effect of having three TD's in a single TR. i.e, no wrapping, no overlapping, no layering. scroll bars are OK though.

Reply With Quote
  #4  
Old April 15th, 2004, 09:26 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
What about just assigning each DIV a percentage width?

Reply With Quote
  #5  
Old April 16th, 2004, 03:26 AM
DingoChopChop DingoChopChop is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 3 DingoChopChop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is the result of my efforts: Drag the thin line in the middle to resize dynamically. (IE aware only)

Code:
<html>
<HEAD>
<style type="text/css">
body {
}
#div22 {
 Position: absolute;
 left : 210px;
 border : solid 1px green;
 background-image : url(blue-wave-back.jpg)
}
#div3 {
 position:absolute;
 height:90%;
 width:100px;
 border:solid 2px red;
}
#div4 {
 position:absolute;
 height:90%;
 width:60%px;
 left:140px;
 border:solid 2px blue;
}
#image2 {
 cursor:col-resize;
 backgroundRepeat=repeat-y;
}
</style>
<SCRIPT language="javascript">
/* only the img tag supports dragging without first selecting text */
 var xOffSetL = 10;
 var xOffSetR = 5;
 
function window.onload() {
 image2.style.height = document.body.clientHeight - (image2.offsetTop+20);
 div22.style.posLeft = 150;
 div3.style.posWidth = (div22.style.posLeft-xOffSetL);
  
 div4.style.posLeft = (div22.style.posLeft+xOffSetR);
 div4.style.posWidth = document.body.clientWidth - div4.offsetLeft;
}
function MoveIt() {
   var x=event.x+document.body.scrollLeft;
   div22.style.posLeft = x-3;
  
   div3.style.posWidth = (div22.style.posLeft-xOffSetL);
  
   div4.style.posLeft = (div22.style.posLeft+xOffSetR);
   div4.style.posWidth = document.body.clientWidth - div4.offsetLeft;
}
</SCRIPT>
</HEAD>
<BODY>
 <div id="div22" ondrag="MoveIt()" ><img id="image2" src="" width="3" height="300" ></div>
 <div id="div3" >div3</div>
 <div id="div4" >div4</div>
</BODY>
</html>
  

Reply With Quote
  #6  
Old May 6th, 2004, 03:53 PM
jonny_Q jonny_Q is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 5 jonny_Q User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to jonny_Q Send a message via AIM to jonny_Q
You might try wrapping the whole thing in a table cell, and put nowrap on the table cell... Might work... might not

<table height="100%" width="100%">
<tr>
<td nowrap="nowrap" height="100%" width="100%">
<div id="div1">.....
...</div>
</td></tr></table>

Reply With Quote
  #7  
Old May 10th, 2004, 03:41 AM
kingkeuter kingkeuter is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 kingkeuter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Simple option

Quote:
Originally Posted by DingoChopChop
I would like to place three DIV's next to each other. When the body.width
is less than than width of the first DIV I do NOT want the next two DIV's to wrap.
How can I prevent this?

I have tried position:absolute and flow:right/left without effect.

Cheers,
Colin.

There are many options but a simple solution is placing the DIV's between NOBR tags...

Reply With Quote
  #8  
Old May 11th, 2004, 10:24 AM
stinkoman's Avatar
stinkoman stinkoman is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: New Jersey
Posts: 2 stinkoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

what about a) putting them in a containing div, b) styling them with white-space:nowrap

Reply With Quote
  #9  
Old May 29th, 2004, 11:14 AM
Buster_Apoc Buster_Apoc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: PA
Posts: 5 Buster_Apoc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Buster_Apoc
some idea

That is kinda the problem I had. You could always save it as a picture and then it wouldn't wrap. What I mean is if you have a picture of what is in that div then it would use a scroll bar to see the rest of the picture. just put it in the spot you want and auto scroll. It is the only thing that I have found to work. I used it and wanted to have links and then learned about image mapping to place links and everything looked really nice.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > DIV positioning


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 | 
  
 

Iron Speed




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