My HTML code includes a div
with the display set to flex
using Bootstrap 4. I then inserted another div
inside it and applied position: absolute
along with a transform: rotate
property. Here is an example:
<div class="container">
<div class="area d-flex position-relative">
<div class="title">
title
</div>
<div>
content
</div>
</div>
</div>
CSS:
.inner {
background: #f1f1f1;
}
.title {
transform: rotate(-90deg) !important;
position: absolute;
left: -20px;
top: 43px;
text-align: center;
font-size: 12px;
background-color: #000;
width: auto;
}
Although I have set the width
property to auto
in order to resize the div
with an absolute
position automatically, it does not seem to be working as intended. How can I resolve this issue?
I aim for the result shown in this image: https://i.sstatic.net/DUFnv.jpg
Here is the updated DEMO link:
Demo Here