I am trying to create a CSS widget component using flexbox.
The component has a title (which should have rotated text) and a content area.
Both the title and content should fill the height of the parent container, the title should be 15 pixels wide, and the content should then be stretched to fill the remainder.
So far, I get 100% content, but for some reason, the header does not fill the height of the parent container.
I still have this:
.widget { height: 200px; width: 200px; border: 1px solid #ddd; background-color: #eee; display: flex; } .widget-header { background-color: #1976D2; color: #fff; transform: rotate(-90deg); border: 1px solid red; font-size: 10px; flex: 0; height: 15px; align-self: center; text-align: center; } .widget-content { border: 1px solid blue; flex: 1; }
<div class="widget"> <div class="widget-header">order summary</div> <div class="widget-content"> <p>some text here</p> <p>some more text ...</p> </div> </div>
CodePen: http://codepen.io/go4cas/pen/XpryQR
source share