Vertical divider doesn't work in Bootstrap 3

前端 未结 6 2068
小蘑菇
小蘑菇 2021-02-01 00:16

I opened the Nav example which comes with the standard Bootstrap download (bootstrap-3.0.0\\examples\\navbar\\index.html) and added vertical dividers between two of the links.

6条回答
  •  清歌不尽
    2021-02-01 00:58

    as i also wanted that same thing in a project u can do something like

    HTML

    CSS

    .divider-vertical {
        height: 100px;                   /* any height */
        border-left: 1px solid gray;     /* right or left is the same */
        float: left;                     /* so BS grid doesn't break */
        opacity: 0.5;                    /* optional */
        margin: 0 15px;                  /* optional */
    }
    

    LESS

    .divider-vertical(@h:100, @opa:1, @mar:15) {
        height: unit(@h,px);             /* change it to rem,em,etc.. */
        border-left: 1px solid gray;
        float: left;
        opacity: @opa;
        margin: 0 unit(@mar,px);         /* change it to rem,em,etc.. */
    }
    

提交回复
热议问题