0

I have a Div cointainer whit fixed width and heigth, and inside it I have text with unknow length.

I want see all text, and the only solution is adjust font-size or similar. And I can't use javascript because is for a report using freemarker and flying saucer to export html to pdf.

Is there any way to do this without javascript?

    .address{
        /*Fixed position and size*/
        top: 62.9mm;
        left: 107mm;
        width: 95mm;
        height: 5mm;
    }
    .label{
        position: absolute;
        overflow:  hidden;
    }
    <div class="label address label_resize">Street short</div>

enter image description here

    .address{
        /*Fixed position and size*/
        top: 62.9mm;
        left: 107mm;
        width: 95mm;
        height: 5mm;
    }
    .label{
        position: absolute;
        overflow:  hidden;
    }
    <div class="label address label_resize">Street whit a large name in a village whit a large name in a country whit a very very big name</div>

enter image description here

hlastras
  • 324
  • 5
  • 16
  • This is not duplicated, because viewport-percentage length is based on width of container. In my case width never change, only change the text length. – hlastras Jul 10 '18 at 09:20
  • If the width of Div is always the same, css always apply the same font-size. I want the text to be adjusted so there is no overflow – hlastras Jul 10 '18 at 09:34

0 Answers0