SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get main wrapper to grow with window maximize?

    Hello, how do I get the main div to expand to the whole window when t is maximized? Now, it is fixed based on how much content is in the smaller div inside it. Example better explains it. Maximize the window:

    http://dlis.dos.state.fl.us/_dev/ken...rs/contact.htm

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To make an element relative to the browser window, specify the dimensions in percents. (Or don't specify a width at all, or use width:auto.)
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I want to have the wrapper expand with the window, but have a min-width of 725px to display correctly on an 800x600 monitor and still display the site correctly and have a 5px margin around the wrapper. I also want a header and a footer. I know this is easy stuff, but all the little hacks and what not are what throw me off. 95% of our users have IE6, the 3% that uses Fx is likely me and the three of us in the IT dept. I hate that things look radically different bn browsers because it is a PITA to make everyhting lok ok. This is so frustrating, I wish IE would get its "I'm going to do whatever the hell I want" mentality out of its head and comply for once. </rant> I'm going on break

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I'm trying to go through it and convert your two letter appreviations to something I can understand. There's a lot I don't understand in that code like the head+body, * html, or any ">" things. I wish I knew what each statement meant instead of just copying it from someone else.

    How the site looks from when I started this thread is how I want it to look, with the exception of the main wrapper not stretching relative to the window size. Is there a way that I could just edit my existing code without re doing everything from scratch again? Also, what is the .px class for? I do appreciate the help.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was playing around with it and renamed some things so that I can understand them. When I added borders to some things everything got all messed up. It's the fact that everything is done with EMs which isn't an absolute value so I can't just add or subtract like I'm used to with non-advanced css. It's all confusing when I goto change anything. And now if I add borders it is going to be different in IE vs. mozilla browsers. Is there a place I can read about how to correctly do this on my own without asking for help all the time?

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohhhh, I think I see what you did, well most of it. You just moved the main div up with a negative margin and added the footer on as an additional div added onto the #main div. I never thought of doing it that way; it's very intuitive. Question: I want it so that the #content div stretches with the window also, but I want it to always have a 10px margin bn it and the footer, that way the footer doesn't run over the #content div in low res monitors or in a small window with lots of content. You sure came up with that fix real quick... Is there anything that I am doing wrong or should be doing a different way as far as css or syntax goes? Or your opinion? Constructive criticism works wonders for me Thanks.

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know my DTD is a problem. I had tryed to convert it to strict and everyhting looked right when i resized some elements except that i had about 10px hanging off the screen to the right no matter the size of the window. I spent far too long trying to figure that out. Are you saying that the original layout that you posted should be my best bet?

  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I created that page from scratch. Obviously my CSS needs some work. I suppose I will just have to re-code the whole thing so that it complies with the "strict" DTD. If it will help get rid of a lot of problems I am having, I will do it that way. I was just hoping that there would be an easier way for me to understand that wouldn't require elaborate negative margins and tons of divs with different margins and properties that I end up losing track of. I had the book "101 css tips and tricks" on my desk but I had to return it last week. It helped a little, but didn't address a lot of my needs.


Bookmarks

Posting Permissions

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