Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    60
    Thanks
    32
    Thanked 0 Times in 0 Posts

    Can you have multiple liquid/fixed design divs in one page?!?!

    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

  • #2
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    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


  • Users who have thanked vikram1vicky for this post:

    adamwestrop (09-15-2011)

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    60
    Thanks
    32
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,234
    Thanks
    10
    Thanked 270 Times in 269 Posts
    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

  • Users who have thanked tracknut for this post:

    adamwestrop (09-15-2011)

  • #5
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    Quote Originally Posted by adamwestrop View Post
    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....



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •