Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive issue with Bootstrap 3.x nav-tabs

I have a bootstrap component nav-tabs and it works normally when the page width is larger than needed for the line (bootstrap .row div). The problem is that when I change the view for mobile devices, responsive design is not behaving as it should and the tabs are misaligned. See the code in the link below, the extent to which the page width is decreased, the Company, Support and Design tabs are behaving strangely.

http://www.bootply.com/Ym1iDjaBjz#

nav-tabs responsive error

like image 328
Renan Avatar asked Apr 25 '26 18:04

Renan


2 Answers

That's normal because there is not enough space for all tabs.

You could reduce padding at .nav-tabs li a to create space or add the folowing rule to make them display in 100% width.

.nav-tabs > li, .nav-tabs li a { display: inline-block; width: 100%; }
.nav-tabs li a { border: 1px solid #ddd; }

enter image description here

Good Luck!

like image 127
emmanuel Avatar answered Apr 27 '26 10:04

emmanuel


I've used the bootstrap-tabcollapase library in similar situations: https://github.com/flatlogic/bootstrap-tabcollapse

It's a third-party bootstrap add-on that converts tabs into accordion panels at small media query widths.

like image 39
Eric Avatar answered Apr 27 '26 10:04

Eric



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!