Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wonky justified nav example #9774

Closed
leeaston opened this issue Aug 18, 2013 · 16 comments
Closed

Wonky justified nav example #9774

leeaston opened this issue Aug 18, 2013 · 16 comments

Comments

@leeaston
Copy link

The justified nav example (http://getbootstrap.com/examples/justified-nav) collapses perfectly when the screen is narrowed, but when the screen is expanded it get wonky.
justified nav
expanded

@liuyl
Copy link
Contributor

liuyl commented Aug 18, 2013

I think it's a browser bug, because it works as expected on IE 10 and latest Firefox.

@leeaston
Copy link
Author

I tested in latest Safari and Chrome on mac.

@mdo
Copy link
Member

mdo commented Aug 18, 2013

This came up before as well—refresh and the browser will fix itself. It's, as far as I can tell, a browser bug specific to WebKit only.

@mdo mdo closed this as completed Aug 18, 2013
@djbender
Copy link

I'm can confirm this bug in Safari 6.0.5 and Chrome 28.0.1500.95 for OS X 10.8.4.

Refreshing did not fix the issue.

@cvrebert
Copy link
Collaborator

We should:

  • Add a note to the docs about this browser bug
  • Add a note to the example about this bug
  • And/or consider removing this example on account of this problematic browser bug

@mdo
Copy link
Member

mdo commented Aug 27, 2013

Added the note to the docs and fixed up some mobile-first styles for default justified nav items.

I played with this a lot again and got nowhere :.

@naderby
Copy link

naderby commented Aug 31, 2013

This is an important design element to leave broken, even if it is a webkit bug.

@davidyeager
Copy link

I've been getting the same problem using Chrome and I came up with a simple workaround. Note that I just taught myself javascript yesterday and so I'm sure this workaround can be improved. Basically on resize of the window remove and then add back the nav bar from the dom. Here's the resize function which I placed at the bottom of the header section:

<script> function refresh() { var container = document.getElementById('container'); var masthead = document.getElementById('masthead'); var jumbotron = document.getElementById('jumbotron'); container.removeChild(masthead); container.insertBefore(masthead, jumbotron); } </script>

Then just modify the body html tag to call this on resize. Note that I added the ID's container, masthead, and jumbotron to the respective dom elements. I'm sure there's a way to do without that, but here's what those changes look like:

...
...

<div id="container" class="container">

  <div id="masthead" class="masthead">
    <h1 class="text-muted"><b>My Project</b></h3>
    <ul class="nav nav-justified">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Projects</a></li>
      <li><a href="#">Services</a></li>
      <li><a href="#">Downloads</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
  </div>

  <!-- Jumbotron -->
  <div id="jumbotron" class="jumbotron">
    <h1>Marketing stuff!</h1>
    <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet.</p>
    <p><a class="btn btn-lg btn-success" href="#">Get started today</a></p>
  </div>

...
...

I hope this works for you. Good luck!

@misterniall
Copy link

I have had success adding this to the navs.less after @media (min-width: @screen-sm-min) { } this hasn't been tested in ie but seems to work in safari and chrome

@media (min-width: @screen-md-min) {
display:inline-block;
}

or this might be better

@media (min-width: @screen-sm-min) {
display:inline-block;
> li {

@takien
Copy link

takien commented Sep 10, 2013

nav-justified make tabs dropdown not working..

@cvrebert
Copy link
Collaborator

@takien That's not relevant to this issue.

@LeeMcNeil
Copy link

This issue seems to have been resolved in the latest version of Chrome. @mdo

@cvrebert
Copy link
Collaborator

@LeeMcNeil Confirmed! I can no longer reproduce on OS X Chrome.

@cvrebert
Copy link
Collaborator

Updated docs warnings accordingly: 4cbc8d4

stempler pushed a commit to stempler/bootstrap that referenced this issue Apr 11, 2014
* Update styling of justified nav links to be more mobile friendly
(with all four rounded corners and some margin between items)
* Add note to docs to callout bogus WebKit rendering on component and
example
@cvrebert
Copy link
Collaborator

Filed WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=138167

cvrebert added a commit that referenced this issue Oct 29, 2014
cvrebert added a commit that referenced this issue Oct 29, 2014
Add WebKit bug for #9774 to Wall of Browser Bugs
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
* Update styling of justified nav links to be more mobile friendly
(with all four rounded corners and some margin between items)
* Add note to docs to callout bogus WebKit rendering on component and
example
cvrebert added a commit that referenced this issue Nov 14, 2014
@twbs twbs locked and limited conversation to collaborators Jan 18, 2015
@cvrebert
Copy link
Collaborator

WebKit bug has been fixed!: http://trac.webkit.org/changeset/190893

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants