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 is shown in two line in flex display

I have a text inside of div , the div has 100% width , I want to have the text in one line rest of the div fills up with middle line till end of the row

 .question-category-sub {    
      display: flex;
    }

    .lineHorizontal__container {
        align-items: center;
        display: flex;
        height: 80px;
    }

    .lineHorizontal {
       border-top: 1px solid rgb(30, 30, 30);
       width: 100%;
     }
 <div class="lineHorizontal__container">
          <div class=" question-category-sub">
              Art - Music
          </div>
          <div class="lineHorizontal">                 
          </div>                  
       </div>

      
   <div class="lineHorizontal__container">
      <div class=" question-category-sub">
          Art - Music
      </div>
      <div class="lineHorizontal">                 
      </div>                  
   </div>

   .question-category-sub {    
  display: flex;
  }

.lineHorizontal__container {
    align-items: center;
    display: flex;
    height: 80px;
}

.lineHorizontal {
   border-top: 1px solid rgb(30, 30, 30);
   width: 100%;
 }

but Art – music are shown in two lines
how can I make Art-Music and the middle line (which should be extended to end of row) in one line. and I should add the text "Art-Music" is dynamic, so it has the dynamic length

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

>Solution :

You should add flex-shrink of 0 to your question-category-sub:

.question-category-sub{
    flex-shrink: 0;
}
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