...

View Full Version : Can you have multiple liquid/fixed design divs in one page?!?!



adamwestrop
09-15-2011, 02:27 PM
Can you have multiple liquid/fixed design divs in one page?!?!

Im guessing no as I haven't see this in effect within multiple pages.....

What I was asking to see whether it is possible to have say a fixed width design of say 700px for say the <body> so reasonable size, however for the say the nav inside the header <div> which incorporates the nav and logo have a resizeable nav bar, I've tried this with say min-width:200px and max-width: properties, however it doesnt resize.

I am guessing it doesnt resize as the main div of the body which encompasses everything is set to fixed, so that applies to the whole layout of the site?

Thanks

vikram1vicky
09-15-2011, 03:31 PM
Layout should be decided according to your website content and type, whether it should be fluid or fixed.

However, child elements should always be adjustable in parent element according their width, either in percentage or fixed width

:)

adamwestrop
09-15-2011, 03:40 PM
So if I have a <div> assigned to the body that has a fixed width.

Inside I could have a ul and li and I could assign a % min and max with to say the li and that should re-size inside the fixed width div?

What are the rules on parent/child in relation to divs and spans? Are they treated as normal? If so, then surely for my scenario above, where I was trying to have a re-sizeable div inside the parent fixed width div, then it would work... But it doesnt.

tracknut
09-15-2011, 04:41 PM
If you nail down any element to a fixed width, then the children of that element are sized in relation to their parent. So in your example a body of 700px will essentially force the site to be fixed, because your inner nav div, regardless of whether you call it 80% or 400px, is always going to be 80% of 700px, or 400px.

Now you can do it the other way around though. A floating width body can stretch with the page, while fixed width elements inside it stay the same width. See http://www.google.com/ for an example of such a page.

Dave

vikram1vicky
09-15-2011, 08:12 PM
So if I have a <div> assigned to the body that has a fixed width.

Inside I could have a ul and li and I could assign a % min and max with to say the li and that should re-size inside the fixed width div?

What are the rules on parent/child in relation to divs and spans? Are they treated as normal? If so, then surely for my scenario above, where I was trying to have a re-sizeable div inside the parent fixed width div, then it would work... But it doesnt.


Yes you can use % or fixed width... for children elements, but % width will be according to their parent's width....

:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum