Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 12-20-2007, 04:14 PM Full width on DIV
Novice Talker

Posts: 9
Trades: 0
I'm having some difficulties with divs. I placed 2 next ot eachother, and gave one of the divs 200px width. How do I make the other div fill the rest of the screen?
Maglor is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-20-2007, 08:57 PM Re: Full width on DIV
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Put Another one next to them with a width of "100%". That will make it fill the rest of the screen, no matter what resolution that you're looking at it in.
__________________
<?php if($Adsense_Revenue > 0): define('HAPPINES','100%'); else: define('HAPPINESS', '0%') endif; ?>
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 12-20-2007, 10:48 PM Re: Full width on DIV
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Put Another one next to them with a width of "100%"
That won't work. You need to float one or both of them, THEN they'll site side-by-side.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 02:40 AM Re: Full width on DIV
Novice Talker

Posts: 9
Trades: 0
I don't want them to float, isn't there a way to "width: 100% - 200px" ?
Maglor is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 03:09 AM Re: Full width on DIV
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
floating is the correct way to have two block element side by side. Otherwise, no matter what width you make one of them, they will "stack" above and below each other.

Unless you start messing about with absolute positioning which will bring down a whole host of new problems.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-21-2007, 07:22 AM Re: Full width on DIV
Novice Talker

Posts: 9
Trades: 0
Oh I get the float thing, but how do I make it have a width of 100% - 200px?
Maglor is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 07:44 AM Re: Full width on DIV
Novice Talker

Posts: 9
Trades: 0
Found it, I just added this to my CSS, and it worked

Code:
position:absolute;
Maglor is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 08:01 AM Re: Full width on DIV
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
No, that's absolute positioning.

Use:
HTML Code:
	<div style="height:300px;width:100%;border:1px dotted red;">
	<div style="height:100%;width:200px;border:1px dotted blue;float:left;margin:0 5px 0 0;">This is a floated container that is 200 pixels wide</div>This is the parent container at 100% width<br>
The content in the parent will occupy the space left by the floated element<br>
Which will be equal to 100% - 200px</div>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-21-2007, 10:33 AM Re: Full width on DIV
Novice Talker

Posts: 9
Trades: 0
That's not exactly what I wanted, I just wanted to place 2 next to each other, not 1 on top of the other
Maglor is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 10:47 AM Re: Full width on DIV
Novice Talker

Posts: 9
Trades: 0
Ok, I found something, now the only problem I have is I need to get height 100%- 100px.

Here's what is looks now: http://kryptosoft.freehostia.com/
Maglor is offline
Reply With Quote
View Public Profile
 
Old 12-21-2007, 12:00 PM Re: Full width on DIV
Novice Talker

Posts: 9
Trades: 0
Never mind guys, I just placed the menu over the whole height of the screen. Thakns very much though
Maglor is offline
Reply With Quote
View Public Profile
 
Old 12-26-2007, 03:21 PM Re: Full width on DIV
Novice Talker

Posts: 7
Trades: 0
I appreciate the replier .weldone
powerfullman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Full width on DIV
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42717 seconds with 12 queries