HTML + CSS: semi-vertical align

This is a discussion on HTML + CSS: semi-vertical align within the Tech Board forums, part of the Community Boards category; Hello all, I'm not at all an HTML and CSS expert - but sometimes I can't get around doing some ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    HTML + CSS: semi-vertical align

    Hello all,

    I'm not at all an HTML and CSS expert - but sometimes I can't get around doing some of it. Just like now; and I've run into a problem that I have no idea how to go about doing this, and a friend of mine requested this layout specifically.

    I want a field (div, probably) with content (the actual site, the div itself will have a scrollbar on overflow) with a specific site (in pixels) in the center of the screen, both vertically and horizontally. I've done this before, though I don't even remember how, just that it was very hacky. But I'd probably be able to do it again.
    The only difference is that this time I want a menu above this div. This menu will have a decent size: it's an image in itself that is quite large. And in some browsers, it won't fit above the content. In this case, I want the content to go down such that the menu fits perfectly.

    So, basically, I have two elements, a menu and a content box. Where:
    1. Content box has a specific size.
    2. The minimum height of the menu is half of (visible_height - content_height), but it gets bigger on overflow.
    3. The content box is directly underneath this menu.

    That should fix it; though I don't think there's a way to directly set this height, but there must be some way to do this...


    Any ideas?


    Thanks in advance,
    EVOEx

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    If you want to get the visible height in pixels you need to use javascript.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Ugly C Lover audinue's Avatar
    Join Date
    Jun 2008
    Location
    Indonesia
    Posts
    489
    If your menu is like a menu bar in windows forms, how about a DIV contains a TABLE with two rows?

    If your menu is like a popup menu in general which floating around the document, you'll need a simple JavaScript to determine its position and probably its size too.
    Just GET it OFF out my mind!!

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Here's a good article that should give you the concepts you need to know which CSS elements to tweak: A List Apart: Articles: In Search of the Holy Grail
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. html web translator/interpreter
    By Aisthesis in forum C++ Programming
    Replies: 6
    Last Post: 08-02-2009, 02:17 PM
  2. Web designer needed! html, css and other design stuff...
    By Akkernight in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 04-11-2009, 09:33 AM
  3. Please Help - C code creates dynamic HTML
    By Christie2008 in forum C Programming
    Replies: 19
    Last Post: 04-02-2008, 07:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21