Jump to content
Sign in to follow this  
Chris92

Div Width Using Poth Px And %

Recommended Posts

Is there anyway to use both px and % but still cover 100% of the page?i have a div container (with 90% width) and within that i want to have another div of say 150px and then next to it another div that covers the rest of the width. Would be willing to use javascript or php as i don't hink there is a way to do it otherwise, but willing to be proven wrong!

Share this post


Link to post
Share on other sites

No scripting required. Give the leftmost div a width in pixels and float:left. Give the rightmost div NO float and NO width dimension. It will size itself to the remaining space and float to the right of the leftmost div.

Share this post


Link to post
Share on other sites
No scripting required. Give the leftmost div a width in pixels and float:left. Give the rightmost div NO float and NO width dimension. It will size itself to the remaining space and float to the right of the leftmost div.
wow it does work :) :) sets the same background in cell 1 if you set no background in cell 1 but have a background in cell 2 but can woork round that :)thanks alot!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...