Link to home
Start Free TrialLog in
Avatar of Melody Scott
Melody ScottFlag for United States of America

asked on

Nav collapse doesn't work correctly

Hello, on mkmeals.com/responsive/index.html, when you make the browser small or use it on a phone, the toggle expands the menu correctly, but it doesn't toggle back to collapse.

I hope I've explained that correctly. Thanks.
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Same old thing mel200.  The code is not valid.  It is full of tagging errors whose nature would definite create an unstable condition. Cleaning up the code might solve this and if not at least we will know what to expect from the code.  Trying to fix presentation issues when the code is not stable is generally not very productive.

Cd&
Avatar of Melody Scott

ASKER

I've heard that the validator doesn't work on Bootstrap, in fact I can probably find that here somewhere, I'll find the question.
Here's what I'm talking about, but I'll run the validator now. Thanks.

http://moz.com/community/q/how-important-is-w3c-validation-for-mobile-sites
Ok, all but two are corrected, I can't seem to fix those, they are related:

 Error Line 144, Column 8: End tag for body seen, but there were unclosed elements.

      </body>


Error Line 31, Column 26: Unclosed element div.

                  <div class="container">
The link you posted is full of incorrect information, and I doubt any of the posters to it have ever actually seen what browser code looks like. I have and the validator follows exactly the same steps as the parser in modern browsers.  The fact that bootstrap results in invalid code is because it is not optimized for anything but Twitter functionality and like many large site they have in-house staff that has develop code that optimizes for their site.  They ignore standards which means that you get inefficient and frequently unreliable code.

Every error forces the parser to execute extra code because the errors have to be resolved by the parser or what get serialize into the the CSS Object and Document Object can crash the browser with an uncaught exception.

As for the remaining error (2 messages but both are caused by the same error), the fact that the container div is not closed means that every element in the page is inheriting from is and it has padding and margin properties that have a definite impact on positioning.

So either close the container or remove if if it is actually extemporaneous.

Cd&
Will adding a </div> at the end of the document close that correctly?
Nope, that doesn't do it. I'm not sure where to put the end div.
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok... this works correctly: mkmeals.com/responsive/side-nav-basic.html

So I'm going to start from scratch with that again, testing as I go. until it breaks. Maybe that will tell me what's going wrong. Thanks for your help.