How to make Bootstrap Panel body with fixed height

前端 未结 2 1692
灰色年华
灰色年华 2021-01-31 13:22

I am using bootstrap\'s panel to display text and image, but as the text grows, the body of the panel also increases. I want to know how to create the body with fix

2条回答
  •  被撕碎了的回忆
    2021-01-31 14:26

    You can use max-height in an inline style attribute, as below:

    jhdsahfjhdfhs
    fdoinfds sdofjohisdfj

    To use scrolling with content that overflows a given max-height, you can alternatively try the following:

    jhdsahfjhdfhs
    fdoinfds sdofjohisdfj

    To restrict the height to a fixed value you can use something like this.

    jhdsahfjhdfhs
    fdoinfds sdofjohisdfj

    Specify the same value for both max-height and min-height (either in pixels or in points – as long as it’s consistent).

    You can also put the same styles in css class in a stylesheet (or a style tag as shown below) and then include the same in your tag. See below:

    Style Code:

    .fixed-panel {
      min-height: 10;
      max-height: 10;
      overflow-y: scroll;
    }
    

    Apply Style :

    jhdsahfjhdfhs
    fdoinfds sdofjohisdfj

    Hope this helps with your need.

提交回复
热议问题