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.

100% Min Height issue

Discussion in 'HTML & Website Design' started by kyle3728, Mar 14, 2013.

  1. #1
    Not sure what I did but I messed something up with my 100% height. It was working great but now I cannot seem to get my <container> to have to have a 100% height. Just quits after the content. My <wrapper> that contains it is how I want it. Cannot seem to find my problem. Must be blind. If you could help it would sure be appreciated. Thanks!

    www.countrysidecabinetshop.net/about.html

    www.countrysidecabinetshop.net/gallery.html
    Solved! View solution.
    kyle3728, Mar 14, 2013 IP
  2. wiicker95

    wiicker95 Active Member

    Messages:
    437
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    75
    #2
    To fix this, just open countryside.css and delete the 24th line where it says min-height:100%;
    It will patch up your issue with the wrapper, but believe me, that is not the only issue your website has.
    From malformed meta, overstuffed keywords, to useless <nav> (sorry html5), <p> that do not even represent paragraphs on your website, etc.
    wiicker95, Mar 14, 2013 IP
  3. kyle3728

    kyle3728 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    My wrapper does not have an issue. That is just were it is supposed to be. If I delete the line you suggest then my container AND my wrapper then have the same problem of not extending to the bottom of the page.
    kyle3728, Mar 14, 2013 IP
  4. wiicker95

    wiicker95 Active Member

    Messages:
    437
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    75
    #4
    Oh, it looks like I didn't get you the first time.

    There are two reasons why your question doesn't make sense:
    -There is not enough content to push it all the way to the bottom, so how and why would you expect to go to the bottom? You can set the min-height in pixels if you want it to, but not really a good idea imho.

    -Different platforms have different resolutions. Try using a handheld device to access your website. It will expand all the way. This is perfectly normal, since the screen dimensions are different. Again, add more content or give your div.content (a class? really?) a min height in pixels. No other (good) way to go.
    wiicker95, Mar 14, 2013 IP
  5. kyle3728

    kyle3728 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    The reason that I expect it to is because I have it set @ min-height: 100;

    I just want the page to auto expand to fill the viewport all the way to the bottom with the footer tied to the very bottom.
    kyle3728, Mar 14, 2013 IP
  6. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #6

    I'm assuming the page in question is gallery.html, but if i'm wrong then feel free to enlighten me.

    The reason your container isn't expanding to the bottom of the screen is because to the container (and the wrapper, too), 100% height is the height of the content. You could fiddle around with CSS all day long but as it looks like it will be changing soon (pictures to be added?) I will go ahead and suggest you simply place a few <br /> tags after the 'Pictures coming soon' line. Really, you shouldn't be spending this much time on something so trivial.


    His meta tags are perfectly fine. Nav isn't useless at all, it's a replacement for Unordered Lists being used out of context (most menu's tend to follow an order) and also menu links having the redundant List Item tag around them. <nav><a href="#">Link</a></nav> is a lot more semantic and logical than <ul><li><a href="#">Link</a></li></ul>. Not to mention it's shorter. It comes down to how much control you want over menu item's in the end. Do you need an extra tag around the menu items to style them correctly? If not, use <nav>.
    And sorry if it seems like I am being pedantic, but there are a number of things with this post too...


    If it doesn't make sense to you, should you be attempting to give advice? He is not expecting the container to do anything, he is attempting to manipulate it to do something he wants it to do. There are many alternatives, 100% screen height hasn't been an issue for years, for example natural content placement, css, html (as I listed above), sticky footers, js fixes, etc etc.
    dlb, Mar 14, 2013 IP
  7. deathshadow

    deathshadow Prominent Member

    Messages:
    5,978
    Likes Received:
    825
    Best Answers:
    144
    Trophy Points:
    395
    #7
    NO, that's NOT what NAV is for -- NAV is to indicate the section is not content and can be skipped by accessibility UA's -- READ about NAV in the specification -- and that's WHY it's redundant to heading navigation if you use headings properly, which is to say NOT how that bloated ignorant half-assed crap known as HTML 5 says to.(assuming you're in a UA that actually cares about accessibility and ever bothered finishing it's HTML 2 implementations, so Opera and Blazer... and JAWS adds the functionality)

    Except at that point what are you gonna do, wrap NAV around every blasted lone anchor on a page? If there's multiple anchors, how are you semantically saying it's not one giant run-on sentence since A doesn't actually change the meaning of nor provide structure to the text it's around?

    Hence the reason to pimp-slap all the re-re's who do crap like this:

    <nav><a href="home">Home</a> <a href="links">Links</a></nav>

    If you are choosing semantic tags based on what you are doing for STYLE, you are choosing the wrong tags for ALL the wrong reasons.

    Oh, and as to the meta? They are broken from poor formatting, and the keywords is overstuffed nonsense since keywords should be 7 or 8 words that exist inside BODY that one want's upranked, totalling less than 128 bytes (some places like SEOWorkers tells you to use even less). Because it's an endless mess of some twenty odd words that do not exist, it will be ignored. Of course, NOBODY using it properly is why EVERYBODY seems to think it no longer has any impact.

    -------------- on to the OP's question -------------

    For the most part I suspect any extra height is coming from a lack of a reset since some browsers start out with padding and margin on BODY or HTML, the presence of border on your min-height element adding to the min-height, the height:100% on a element inside the min-heighted element should either end up too tall or too short causing layout issues... as does the border on the footer which also adds to the height, meaning you'd need to ADD

    Of course that you set border styles without setting it's widths can have all sorts of bizarre behaviors cross browsers... and generally speaking you want min-height layout, you cannot do top or bottom borders or paddings on ANYTHING that has height/min-height set on it.

    There are the markup issues too -- some stupid header DIV and IMG tag doing H1's job (with an image replacement technique like gilder-levin) so you have a logical document structure and images off graceful degredation, you've got P+B doing H2's job (Not that I'd repeat that text again for no reason!), P and a non-breaking space doing padding's job, an extra DIV with inlined style for christmas only knows what, P and STRONG around text in the footer that is neither a paragraph nor should it be recieving emphasis, etc, etc...

    So the first order of business is to clean up the markup, excuse me as I swing an axe at the HTML 5 asshattery:
    Code (Text):
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    3. <html
    4.     xmlns="http://www.w3.org/1999/xhtml"
    5.     lang="en"
    6.     xml:lang="en"
    7. ><head>
    8.  
    9. <meta
    10.     http-equiv="Content-Type"
    11.     content="text/html; charset=utf-8"
    12. />
    13.  
    14. <meta
    15.     http-equiv="Content-Language"
    16.     content="en"
    17. />
    18.  
    19. <meta
    20.     name="viewport"
    21.     content="width=device-width; initial-scale=1.0"
    22. />
    23.  
    24. <meta
    25.     name="description"
    26.     content="Countryside Cabinet Shop has been in business for more than 20 years, with a history of craftsmanship going back generations."
    27. />
    28.  
    29. <meta
    30.     name="keywords"
    31.     content="Cabinet,Craftsman,Kitchens,Bath,Offices,Furniture,Installation"
    32. />
    33.  
    34. <link
    35.     type="text/css"
    36.     rel="stylesheet"
    37.     href="screen.css"
    38.     media="screen,projection,tv"
    39. />
    40.  
    41. <title>
    42.     About Our Cabinetry Business
    43. </title>
    44.  
    45. </head><body>
    46.  
    47. <div id="pageWrapper">
    48.  
    49.     <h1>
    50.         Countryside Cabinet Shop
    51.         <span><!-- image replacement --></span>
    52.     </h1>
    53.    
    54.     <ul id="mainMenu">
    55.         <li><a href="index.html">Home</a></li>
    56.         <li><a href="services.html">Services</a></li>
    57.         <li>
    58.             <a href="gallery.html">Gallery</a>
    59.             <ul>
    60.                 <li><a href="kitchengallery.html">Kitchens</a></li>
    61.                 <li><a href="bathgallery.html">Bath</a></li>
    62.                 <li><a href="officegallery.html">Offices</a></li>
    63.                 <li><a href="entertainmentgallery.html">Entertainment</a></li>
    64.                 <li><a href="storagegallery.html">Storage</a></li>
    65.                 <li><a href="conveniencegallery.html">Convenience</a></li>
    66.                 <li><a href="miscgallery.html"html>Misc</a></li>
    67.                 <li><a href="rendergallery.html">Renders</a></li>
    68.             </ul>
    69.         </li>
    70.         <li><a href="location.html">Location</a></li>
    71.         <li><a href="about.html">About</a></li>
    72.         <li><a href="contact.html">Contact</a></li>
    73.     </ul>
    74.    
    75.     <div id="content">
    76.         <p>
    77.             Countryside Cabinet Shop has been in business for more than 20 years, with a history of craftsmanship going back generations.  What started as a hobby has grown to become a full time cabinetry business.
    78.         </p><p>
    79.             Our main focus is on quality and customer satisfaction.  We believe in quality, and every cabinet or piece of furniture we build speaks for itself.  We install what we build, because we believe that cabinetry or furniture is only as good as the installer.
    80.         </p><p>
    81.             We are excited about the future and look forward to serving our community in the years to come.  You can rest assured that we will stand behind our craftsmanship.  Our goal is to design and build a product that is customized to fit your specific needs.  We will work with you from the early stages of design all the way to installation and completion.
    82.         </p>
    83.     <!-- #content --></div>
    84.    
    85.     <hr />
    86.    
    87. <!-- #pageWrapper --></div>
    88.    
    89. <div id="footer">
    90.     Quality From Design To Installation
    91. <!-- #footer --></div>
    92.  
    93. </body></html>
    Gimme a few minutes to wake up and get some coffee in me, and I'll belt out the CSS to go with that 'fixing' any issues. A good number of issues can be resolved by adding a reset and explicitly declaring the border widths, NOT setting top or bottom borders.
    deathshadow, Mar 14, 2013 IP
  8. deathshadow

    deathshadow Prominent Member

    Messages:
    5,978
    Likes Received:
    825
    Best Answers:
    144
    Trophy Points:
    395
    #8
    Oh, some other issues I'm observing -- you're setting max-width on HTML, that doesn't even make any sense... there's no such thing as a four digit color like #3333; -- it's either three digits or six. you do NOT set min-height on body, there is no reason to ever say width:100%; on body. You probably SHOULD have a max-width on the wrapper, there is no reason to relop or set the width on .container -- AND the height declaration on that is more likely to cause problems than solve them. (though again, not sure why that even exists). NO CLUE why you are setting text-shadow on IMG, your anchor styling declarations aren't just pointlessly redundant, they're also gibberish, and as mentioned all your border declarations are NOT compatible with a min-height layout... I would also advise NOT trying to perfect width float the main menu, and stripping that float nonsense off it in the media queries.

    I'll have a working demo in a bit for you.

    --- edit -- you also don't have to say -webkit and -moz for background-size. NOBODY uses FF 4.0 anymore, and the -webkit version never supported 'cover' anyways.
    deathshadow, Mar 14, 2013 IP
  9. #9
    Here's what I came up with:
    http://www.cutcodedown.com/for_others/kyle3728/template.html

    As with all my examples the directory:
    http://www.cutcodedown.com/for_others/kyle3728/

    is unlocked for easy access to the gooey bits.

    I had to take a LOT of stylistic liberties since much of your design wasn't really viable for responsive/semi-fluid layout anyways... and yes, I opened it up semi-fluid. That meant redoing the header image, but that's ok since to be frank, those oddball borders and suddenly stopping gradient looked more like rendering errors than intentional design anyways. I also changed how the background was positioned, using "background-size:100% auto" instead of cover with it set to "bottom center" -- allowing me to chop a bunch of unneccessary space off the top of the image and shrinking it's filesize a wee bit. "cover" is handy, but on a image like that I felt it was chopping off so much at the sides and resizing so much, you couldn't even tell what that massive image was even supposed to be. (Though honestly, IMHO that image is WAY too large for deployment as part of a theme -- though I think I've told you that in the past).

    Your borders were most of the problem -- the fancier styles like 'raised' are problematic enough -- without adding them to elements involved in a min-height layout... PARTICULARLY on the slid up footer and the min-heighted element itself... so those had to be axed. Probably for the better anyways since you were getting all sorts of funky border garbage that didn't line up at ALL, and borders like that will make old timers knee-jerk into saying "look at the 1995 design".

    Hope this helps.
    deathshadow, Mar 14, 2013 IP
  10. creativewebmaster

    creativewebmaster Active Member

    Messages:
    641
    Likes Received:
    6
    Best Answers:
    4
    Trophy Points:
    53
    #10
    user below example:

    html,body {
    margin:0;
    padding:0;
    height:100%; /* needed for container min-height */
    background:gray;

    font-family:arial,sans-serif;
    font-size:small;
    color:#666;
    }
    creativewebmaster, Mar 14, 2013 IP
  11. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #11
    My oh my, you are correct. I fail to understand how they could mess up this new element by asking people to still use an UNORDERED LIST inside it, for a menu, whose items usually follow an order... It fails logic. Thanks for the heads up.
    dlb, Mar 15, 2013 IP
  12. wiicker95

    wiicker95 Active Member

    Messages:
    437
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    75
    #12
    Exactly. That is exactly why NAV, and most, if not all new html5 tags are pure crap. They are all made to justify the misuse of what we already had, which was great. So many people are slapping a DIV around their navbar UL, which is pointlessly redundant, since UL is a block-level element.

    Then we have SECTION, abused by the same people who did it with tables, than with DIV. But in this case, it's worse : SECTION has a semantic meaning, whereas DIV doesn't.

    ASIDE, that's a very special one. It represents a section which is positioned aside. But wait, aasin't it presentation? Yes, it is! Since the latter has no business in your markup, so does ASIDE.

    There is one tag that is redundant, but somewhere less than the others. FOOTER it is.
    But honestly, what can <footer> do that <div id="footer"> can't? Oh yeah, you have to include some nasty bandwidth-eating javascript, else IE will go "bloah, I ain't stylin that".
    wiicker95, Mar 15, 2013 IP
  13. kyle3728

    kyle3728 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #13
    Thanks a bunch! That looks a lot like I want it to look. Now I need to study the code until I understand it as I think a bunch of my problems have come from copy and pasting random suggestions and tutorials into my code. I have learned a lot but then when something becomes incompatible with something else it is over my head. And yes those images all needed reworked as that was one of the very first things I did starting with this whole project and trying to do things on Photoshop that I didn't know how to do with CSS. Back to my background image, is there a way to just fill in those margins on the side with it as all we ever need is just that little slice to fill the margin. Potential to decrease file size?
    kyle3728, Mar 15, 2013 IP