Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Text not clipping correctly in CSS

I have a problem with text clipping, practically when I set the div to a lower width than the text, it disappears. I want it to clip words as it reduces its size… I tried with overflow: hidden and also text-overflow: clip but it’s not working as I want. Here’s the code, thank you in advance.

.finalCutStyleButton{

    width: 90mm;
    height: 20mm;

    background-color: #b3be9e;

    animation: test 2s ease-in;
}

@keyframes test{

    from{
        width: 90mm;
    }
    to{
        width: 30mm;
    }
}
.title{

    font-size: 10mm;
    font-family: 'SFProBold', sans-serif;
    font-weight: bold;
    display: inline-block;
    width: auto;
}
<div class = "finalCutStyleButton adjustPadding">

   <h1 class = "title">VIDEO EDITING</h1>
</div>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

try adding same keyframe logic to the text:

.finalCutStyleButton {
  width: 90mm;
  height: 20mm;

  background-color: #b3be9e;
  display: flex;
  align-items: center;
  animation: test 2s ease-in;
}

@keyframes test {
  from {
    width: 90mm;
  }
  to {
    width: 30mm;
  }
}
.title {
  font-size: 10mm;
  margin: 0 0;
  font-family: "SFProBold", sans-serif;
  font-weight: bold;
  display: inline-block;
 min-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
<div class="finalCutStyleButton adjustPadding">
      <h1 class="title">VIDEO EDITING</h1>
    </div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading