Jump to content

Div Width Using Poth Px And %


Chris92
 Share

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!

Link to comment
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.

Link to comment
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!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...