HighDots Forums  

DIV quickie...

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss DIV quickie... in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mel
 
Posts: n/a

Default DIV quickie... - 01-05-2005 , 11:04 AM






how can i have 2 divs, one 100px and the other to fill the rest of the space
side by side ?

example is appreciated;

thanks



Reply With Quote
  #2  
Old   
Chris Leipold
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:16 AM






Mel wrote:
Quote:
how can i have 2 divs, one 100px and the other to fill the rest of the space
side by side ?
Try

[html]
<div id="div1">...</div>
<div id="div2">...</div>

[css]
#div1 { width:100px;float:left;}

Chris


Reply With Quote
  #3  
Old   
Mel
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:17 AM



what would the css be for div2 ?

thanks for help
"Chris Leipold" <cleipold (AT) dietzk (DOT) de> wrote

Quote:
Mel wrote:
how can i have 2 divs, one 100px and the other to fill the rest of the
space
side by side ?

Try

[html]
div id="div1">...</div
div id="div2">...</div

[css]
#div1 { width:100px;float:left;}

Chris



Reply With Quote
  #4  
Old   
Mark Tranchant
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:27 AM



Mel wrote:
Quote:
how can i have 2 divs, one 100px and the other to fill the rest of the space
side by side ?
Set the main one with a left (or right) margin of 100px, and float the
100px one to the appropriate side.

--
Mark.
http://tranchant.plus.com/


Reply With Quote
  #5  
Old   
Mel
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:37 AM



maybe i am not clear.

i need to have

XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

i use div1 style 100px for the left div. i can not set the width of the
second div to 100%

try it for yourself

thanks
Mel


"Mark Tranchant" <mark (AT) tranchant (DOT) plus.com> wrote

Quote:
Mel wrote:
how can i have 2 divs, one 100px and the other to fill the rest of the
space
side by side ?

Set the main one with a left (or right) margin of 100px, and float the
100px one to the appropriate side.

--
Mark.
http://tranchant.plus.com/



Reply With Quote
  #6  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:39 AM




"Mel" <mel.m.heravi (AT) hp (DOT) com> wrote

Quote:
what would the css be for div2 ?

thanks for help
"Chris Leipold" <cleipold (AT) dietzk (DOT) de> wrote in message
Nothing. If div1 floats, div2 automatically wraps around it--that's what
"float" means.

Quote:
news:342i79F475rgbU1 (AT) individual (DOT) net...
Mel wrote:
how can i have 2 divs, one 100px and the other to fill the rest of the
space
By the way, this is what happens when you put your response *before* the
text to which you're responding. Eventually the message become unreadable.

Quote:
side by side ?

Try

[html]
div id="div1">...</div
div id="div2">...</div

[css]
#div1 { width:100px;float:left;}

Chris




Reply With Quote
  #7  
Old   
Mel
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:45 AM



i need the second div to OCCUPY the rest of the way to the right of div1


"Harlan Messinger" <h.messinger (AT) comcast (DOT) net> wrote

Quote:
"Mel" <mel.m.heravi (AT) hp (DOT) com> wrote in message
news:41dc1360 (AT) usenet01 (DOT) boi.hp.com...
what would the css be for div2 ?

thanks for help
"Chris Leipold" <cleipold (AT) dietzk (DOT) de> wrote in message

Nothing. If div1 floats, div2 automatically wraps around it--that's what
"float" means.

news:342i79F475rgbU1 (AT) individual (DOT) net...
Mel wrote:
how can i have 2 divs, one 100px and the other to fill the rest of
the
space

By the way, this is what happens when you put your response *before* the
text to which you're responding. Eventually the message become unreadable.

side by side ?

Try

[html]
div id="div1">...</div
div id="div2">...</div

[css]
#div1 { width:100px;float:left;}

Chris






Reply With Quote
  #8  
Old   
Chris Leipold
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 11:53 AM



Mel wrote:
Quote:
i need the second div to OCCUPY the rest of the way to the right of div1
It will. If you do like Harlan and I advised.

Chris


Reply With Quote
  #9  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 12:40 PM




"Mel" <mel.m.heravi (AT) hp (DOT) com> wrote

Quote:
i need the second div to OCCUPY the rest of the way to the right of div1


"Harlan Messinger" <h.messinger (AT) comcast (DOT) net> wrote in message
news:342jhjF457oi8U1 (AT) individual (DOT) net...

"Mel" <mel.m.heravi (AT) hp (DOT) com> wrote in message
Obviously you missed what I said in my previous message about where in the
preceding text you put your responses, which I guess demonstrates my point.

Quote:
news:41dc1360 (AT) usenet01 (DOT) boi.hp.com...
what would the css be for div2 ?

thanks for help
"Chris Leipold" <cleipold (AT) dietzk (DOT) de> wrote in message

Nothing. If div1 floats, div2 automatically wraps around it--that's what
"float" means.
And it won't unless we tell you the same thing more than twice?

Quote:
news:342i79F475rgbU1 (AT) individual (DOT) net...
Mel wrote:
how can i have 2 divs, one 100px and the other to fill the rest of
the
space

By the way, this is what happens when you put your response *before* the
text to which you're responding. Eventually the message become
unreadable.

side by side ?

Try

[html]
div id="div1">...</div
div id="div2">...</div

[css]
#div1 { width:100px;float:left;}

Chris







Reply With Quote
  #10  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: DIV quickie... - 01-05-2005 , 12:41 PM




"Mel" <mel.m.heravi (AT) hp (DOT) com> wrote

Quote:
maybe i am not clear.

i need to have

XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

i use div1 style 100px for the left div. i can not set the width of the
second div to 100%

try it for yourself
Why don't YOU try it instead of arguing with everyone who's given you the
correct answer?

Quote:
thanks
Mel


"Mark Tranchant" <mark (AT) tranchant (DOT) plus.com> wrote in message
news:41dc1577$0$47609$ed2619ec (AT) ptn-nntp-reader02 (DOT) plus.net...
Mel wrote:
how can i have 2 divs, one 100px and the other to fill the rest of the
space
side by side ?

Set the main one with a left (or right) margin of 100px, and float the
100px one to the appropriate side.

--
Mark.
http://tranchant.plus.com/




Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.