1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is there anyways to find the actual height & apply it to CSS?

Discussion in 'CSS' started by Nima, Dec 31, 2006.

  1. #1
    Is there anyways to find the actual height & apply it to CSS?

    I have 100% height problems in my DIV & CSS design. So I was wondering if there is a script that I can use to find the actual height of every page and apply it to the DIVs in the page...


    Thanks
    Nima
     
    Nima, Dec 31, 2006 IP
  2. rb3m

    rb3m Peon

    Messages:
    192
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Edit: Sorry, I realized you said page, not window.

    Do you have an example of what you mean?
     
    rb3m, Dec 31, 2006 IP
  3. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #3
    Hmm..

    I've heard about it, but never saw any code myself...

    Look at my code here: pokereagles.com/poker-movies/

    The left menu height is not 100% and from what I have understood is it is almost impossible to fix it with height:100%;

    I was thinking if I could somehow get the actual of height each page when it is loaded and apply that to the left menu and Main-Content it would be fixed...

    Thanks
    Nima
     
    Nima, Dec 31, 2006 IP
  4. rb3m

    rb3m Peon

    Messages:
    192
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    One just has to get inside the mind of those wacky styles and work around their twisted logic.

    Try this:
    
    #wrapper 
    {
    	width: 800px;
    	margin-left:auto;
    	margin-right: auto;
    	margin-top:100px;
    	background: white;
    }
    
    #main {
    	background: #eaeaea;
    	border:5px solid #FFFFFF;
    	padding:5px;
    	width:620px;
    	margin-left: 160px;
    }
      
    #nav-one {
    	width:150px;
    	background: #f5f5f5;
    	border:5px solid #FFFFFF;
    	position: absolute;
    	top: 100px;
    }
    
    
    Code (markup):
     
    rb3m, Dec 31, 2006 IP
    Nima likes this.
  5. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #5
    That doesnt fix the height problem though. It just ads white background
     
    Nima, Dec 31, 2006 IP
  6. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #6
    Actually I just did that and tweaked it a little. It works great, except the background color is not showing up in Firefox. Any idea why?

    Thanks
    NIma
     
    Nima, Dec 31, 2006 IP
  7. rb3m

    rb3m Peon

    Messages:
    192
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It uses a different technique so that wrapper wraps around main (it didn't before because of the float) and position nav-one to the top left of wrapper. Now wrapper has the correct height and you can use height: 100% (although with some fiddling around with this value, and play around with the margins to make it look right).

    Edit: Mmm... It should work in Firefox as well. I made a copy on your site in my local system to play with the css and it shows fine in both Firefox and IE.
     
    rb3m, Dec 31, 2006 IP
  8. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #8
    Nima, Dec 31, 2006 IP
  9. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #9
    The issue isn't about 100% heights, a Bad Idea®, it's about making two columns appear to be the same height. Google for "faux columns"; ALA has the seminal article. You may see an example at my http://garyblue.port5.com/webdev/2col.html

    Plus there is the issue of enclosing float elements. IE, in defiance of the standards (what else is new?), encloses floats whose parent has hasLayout==true.

    In the example you cited, IE seems OK, only because it's screwed up. Firefox is rendering correctly as coded.

    cheers,

    gary
     
    kk5st, Jan 1, 2007 IP
  10. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #10
    well,

    is there a solution for this problem?
     
    Nima, Jan 1, 2007 IP
  11. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #11
    Did you read the references I gave you?

    gary
     
    kk5st, Jan 1, 2007 IP
  12. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #12
    None of those links work
     
    Nima, Jan 1, 2007 IP
  13. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hi Nima,

    What exactly are you trying to do (if you don't mind me asking)? Are you looking for a 100% document height for a multi-column layout that will have different background colors without having to use a background image to fake it (yes, this can be done, but it requires some advanced CSS skills and a lot of knowledge about how negative margins work and the cross-browser issues related with them).
     
    Dan Schulz, Jan 3, 2007 IP
  14. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #14
    Dan,
    I dont want to fake the backgrounds. Rather, I prefer not to (unless I dont have a choice).

    The ideal situation is to have 100% height for the two columns (that have different backgrounds). I simply want them to have the same height...

    Nima
     
    Nima, Jan 3, 2007 IP
  15. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Ok, that's going to require the use of negative margins and some clever use of floats then. Can you wait until I get home?
     
    Dan Schulz, Jan 3, 2007 IP
    Nima likes this.
  16. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #16
    Dan,
    I would really appreciate if you can help me out. I did a lot of reading and fixed my other CSS problems. but I'm stuck in this one...

    Thanks again,
    Nima
     
    Nima, Jan 3, 2007 IP