简体   繁体   中英

How to reduce the height and text padding of a bootstrap breadcrumb?

I just want to know how to reduce the height and the vertical padding between the text and the box borders of a standard Bootstrap breadcrumb:

 <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <ol class="breadcrumb"> <li class="breadcrumb-item active">Home</li> </ol> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item active">Library</li> </ol> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item"><a href="#">Library</a></li> <li class="breadcrumb-item active">Data</li> </ol> 

Original: 在此输入图像描述

What I need: (reduce the tickness of the bar and the spacing between the text and the bar upper and lower borders. Ths font remains the same size)

在此输入图像描述

Setting padding in .breadcrumb class by override the bootstrap css

 .breadcrumb { padding: 2px 15px !important; } 
 <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <ol class="breadcrumb"> <li class="breadcrumb-item active">Home</li> </ol> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item active">Library</li> </ol> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item"><a href="#">Library</a></li> <li class="breadcrumb-item active">Data</li> </ol> 

change the padding

CODE:

.breadcrumb {
    padding-top: 0px;
    padding-bottom: 0px;
 }

EXAMPLE: https://jsfiddle.net/a2v66hrh/

Add this to your custom CSS file for example:

.breadcrumb {
   padding: 4px 15px;
}

Bootstrap defines a top and bottom padding of 8pk. Just use any lower value than this.

Just add below css

.breadcrumb {
    padding:1px 15px !important;
 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM