If we add more sample-sentence
divs in the given code the gray container gets bigger and fit with the new height of the content.
I want to get the same behavior with rtl-container
so that if we add more li
s, the gray container should get bigger to fit the new height of rtl-container
.
How can I do that without ruining the whole layout?
.explainer-container {
position: relative;
overflow: hidden;
/*height: 47vh;*/
top: 9vw;
z-index: 11;
max-width: 70vw;
background-color: rgba(6, 0, 15, 0.6);
padding: 0;
font-size: 1.25vw;
border-radius: 1rem;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, .3), 0 0.0625rem 0.125rem rgba(0, 0, 0, .2);
margin-left: auto;
margin-right: auto;
}
.explain-header {
padding: 1.2em 1em;
color: #e9e4f0;
}
#phrase {
font-family: "Open Sans Bold";
color: #ff9100;
}
#colon {
font-family: "Vazir-Bold";
color: #ff0033;
}
#en-definition{
font-family: "Open Sans Light";
color: #f0ede9;
}
#title-synonym {
font-family: "Open Sans Bold";
font-size: 1vw;
color: #4287f5;
}
#synonym {
font-family: "Open Sans Regular";
font-size: 1vw;
color: #b0bfd9;
}
.sample-sentence {
display: grid;
justify-content: start;
max-width: 50%;
margin: 0 !important;
}
.rtl-sample {
font-family: "Vazir-Thin";
font-size: 0.9vw;
margin-top: 1vh;
margin-bottom: 0;
direction: rtl;
}
.eng-sample {
font-family: "Open Sans Regular";
font-size: 1.2vw;
color: #eee6f0;
margin-bottom: 0;
}
/*Explain Styles*/
.rtl-container {
position: absolute;
overflow: hidden;
max-width: 35vw;
max-height: 47vh;
width: 40vw;
z-index: 11;
outline: 0.1vw dashed orange;
top: 0;
right: 0;
padding: 0.5em 0em;
}
.rtl-explain {
position: relative;
font-family: "Vazir-Thin";
direction: rtl;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
text-align: right;
width: 100%;
font-size: 1vw;
color: rgb(248, 247, 250);
opacity: 0;
margin: 0 auto;
}
<div class="explainer-container">
<div class="explain-header">
<span id="phrase">to make up for</span>
<span id="colon">:</span>
<span id="en-definition">to prepare for sth</span>
<br>
<span id="title-synonym">synonym(s):</span>
<span id="synonym">to prepare - to plan</span>
<!-- <div class="sample-sentence">
<p class="eng-sample">I could make up a bed for you on the sofa.</p>
<p class="rtl-sample">ی رختخواب روی کاناپه برات آماده می کنم.</p>
</div> -->
<div class="rtl-container">
<p id="rtl-explain" class="rtl-explain captionShow"><ul><li>بهترین روش برای ما استفاده از این <span class="colored">I</span> <span class="colored">will</span> <span class="colored">be</span> <span class="colored">+</span> <span class="colored">ing</span> هست.</li><li>در تمام این روش ها ما داریم از <span class="colored">رنگ های مختلف</span> استفاده می کنیم. به امید دیدار... <span class="round-bracket">( </span>ارادتمند شما<span class="round-bracket"> )</span></li><li>ادامه دارد این ماجرا</li></ul></p>
</div>
</div>
</div>
Edit:
I've edited the code and removed all sample-sentence
divs now we can only see portion of the li
(only two of them)...
In the current code we want to expand the grey container to see all the li
s...