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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Width: 100% - 185px

    Hi there,

    again I'm in need of help with some CSS positioning. Below you'll find a snippet of my css and the according html. What I'm trying to achieve is that the menu-div and the content-div end up right next to each other and the content-div fils all the remaining space. So actually the content-div should be 100% - 185px wide. How to do such a thing?

    CSS:

    Code:
    #main {
      width: 100%;
      background: url(./graphics/main2.jpg) no-repeat right bottom;
    }
    
    #menu {
      height: 300px;
      width: 185px;
      padding-top: 1px;
      padding-left: 20px;
      float: left;
      background: url(./graphics/menu.jpg) no-repeat;
    }
    
    #content {
      float: left;
      height: 375px;
      background: url(./graphics/main_background.jpg) no-repeat;
    }
    HTML:

    Code:
    <div id="main">
     <div id="menu">
      MENU
     </div>
     <div id="content">
      CONTENT
     </div>
    </div>
    Thanx for your help! Michiel

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No float

    Since your menu is in front of the content in the source already, I'd sugggest to not float the content at all, but leave it at auto width (corrections for IE may apply) and give it a proper margin to make room for the menu.
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

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