While implementing the charts
, graphs
inside the tabs
, the content resize issue may occur.
Reason for this type of issue
In Bootstrap tab, while we switching tabs only the active tab will have the property display: block;
rest of the tab-contents
are applied to display: none;
.
This is the major cause of this issue if the div element has a property display: none;
, there the width is also considered as 0px.
To override this issue I have added the following CSS, Instead of hiding the tabs by using display: none;
, I handled with height & overflow property by this method the width will not set to 0px.
CSS
.tab-content>.tab-pane {
height: 1px;
overflow: hidden;
display: block;
visibility: hidden;
}
.tab-content>.active {
height: auto;
overflow: auto;
visibility: visible;
}
Thanks.
Note: This is one of the methods to resolve this issue using CSS.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…