简体   繁体   中英

How to bring bootstrap 3 panels into bootstrap 2 website?

I searched alot but couldn't find anything! How can I do it? Is there any library or something like that or any fix ?

Panels in Bootstrap 3 are only construct with CSS. You will find the code in less/panels.less

To make it yourself easy: open panels.less an add the line below at the top of this file:

@import "variables.less";
@import "mixins.less";

Compile this file with any less compiler to css. Copy the result in your BS2 document below the Bootstrap's CSS.

See: http://bootply.com/79222

The panel header (h3) got a line-height of 40px from the BS2 Css, ao add one extra line of css to undo this: .panel-heading > h3 {line-height:20px;} .

You could also copy the panels.less to your Twitter's Bootstrap 2 less and import it in bootstrap.less and compile this. In this case copy the panel variables from variables.less to variables.less of Bootstrap 2 at least.

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