Note that there are some explanatory texts on larger screens.

plurals
  1. POResponsive CSS with Twitter Bootstrap Issue
    primarykey
    data
    text
    <p>I have a NavBar in my web-app using Ruby on Rails and Twitter Bootstrap.</p> <p>The NAVBAR looks well in the browser as: <img src="https://i.stack.imgur.com/6kOus.png" alt="NAVBAR in the browser"></p> <p>But, the Navbar breaks when I look up the web-app in the browser on my Galaxy Note.</p> <p><img src="https://i.stack.imgur.com/Tox0g.png" alt="NAVBAR broken in smaller screen"> <em>Snippet from app/views/layouts/application.html.erb</em></p> <pre><code> &lt;div class="masthead"&gt; &lt;h3 class="active"&gt;&lt;a href="/"&gt;WebsiteName&lt;/a&gt;&lt;/h3&gt; &lt;div class="navbar"&gt; &lt;div class="navbar-inner"&gt; &lt;div class="container"&gt; &lt;ul class="nav"&gt; &lt;li class="active"&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/about"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/contact"&gt;Contact Us&lt;/a&gt;&lt;/li&gt; &lt;% if current_user %&gt; &lt;li class="dropdown"&gt; &lt;a class="dropdown-toggle" data-toggle="dropdown" href="#"&gt; &lt;strong&gt;&lt;%= current_user.name %&gt;&lt;/strong&gt; &lt;b class="caret"&gt;&lt;/b&gt; &lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;li&gt;&lt;a href="/signout"&gt;Sign out&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;% end %&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>The CSS for the NAVBAR</strong> is borrowed primarily from:<br> Justified Nav Example - <a href="http://getbootstrap.com/2.3.2/examples/justified-nav.html" rel="nofollow noreferrer">http://getbootstrap.com/2.3.2/examples/justified-nav.html</a></p> <pre><code> /* Customize the navbar links to be fill the entire space of the .navbar */ .navbar .navbar-inner { padding: 0; } .navbar .nav { margin: 0; display: table; width: 100%; } .navbar .nav li { display: table-cell; width: 1%; float: none; } .navbar .nav li a { font-weight: bold; text-align: center; border-left: 1px solid rgba(255,255,255,.75); border-right: 1px solid rgba(0,0,0,.1); } .navbar .nav li:first-child a { border-left: 0; border-radius: 3px 0 0 3px; } .navbar .nav li:last-child a { border-right: 0; border-radius: 0 3px 3px 0; } </code></pre> <p>How can I fix this? I am learning Responsive CSS these days, and have no idea how to fix it. </p> <p><strong>UPDATE:</strong> </p> <p>Please note that the above problem has been fixed.<br> But I found something wrong when this got fixed though. If I decrease the size of window too much, the navbar gets broken. The User part goes outside the navbar. <strong>The issue is also reflected in the Bootstrap example too</strong>. </p> <p>I'm attaching the screenshots which showcase the issue. To see it yourself, simply decrease the window size in the <a href="http://getbootstrap.com/2.3.2/examples/justified-nav.html" rel="nofollow noreferrer">Bootstrap navbar example</a>. </p> <p><img src="https://i.stack.imgur.com/tNNvM.png" alt="enter image description here"><br> <img src="https://i.stack.imgur.com/tasvB.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload