最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - bootstrap nav header height - Stack Overflow

programmeradmin1浏览0评论

How to make the height of all names of the tabs same size? At LI the height is same, but if I do for A height: 100% nothing changes. Thanks

simple bootstrap

example

How to make the height of all names of the tabs same size? At LI the height is same, but if I do for A height: 100% nothing changes. Thanks

simple bootstrap

example

Share Improve this question edited Mar 26, 2015 at 19:20 Trevor 16.1k9 gold badges55 silver badges85 bronze badges asked Sep 24, 2013 at 10:04 Misha KondratevMisha Kondratev 1012 silver badges4 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You can use javascript

$(document).ready(function(){
   var highest = null;

   $(".nav-tabs a").each(function(){  //find the height of your highest link
       var h = $(this).height();
       if(h > highest){
          highest = $(this).height();  
       }    
    });

   $(".nav-tabs a").height(highest);  //set all your links to that height.
});

http://jsfiddle/wW2py/9/

For CSS you can do

.nav-tabs a {
   height: 62px;  
}

For your example 62px works, but you'll need to adjust it so that it is big enough to fit the tab with the most text. Also make sure you apply your css after the bootstrap css.

http://jsfiddle/p9eFQ/

发布评论

评论列表(0)

  1. 暂无评论