Is there a way to make the contents of an element fill the available height before expanding width?Make a div fill the height of the remaining screen spaceExpand a div to take the remaining widthmake div's height expand with its contentHow to make an inline-block element fill the remainder of the line?How to vertical align an inline-block in a line of text?Make CSS Div height Equal To Contents without changing widthHow to make expandable div with min-heightHow to get inline elements to expand to line-heightFill max-width before max-height?How to make div expand towards top when height modifies?

Why can Carol Danvers change her suit colours in the first place?

A social experiment. What is the worst that can happen?

Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?

How to cover method return statement in Apex Class?

Calculating total slots

The probability of Bus A arriving before Bus B

Pre-mixing cryogenic fuels and using only one fuel tank

Terse Method to Swap Lowest for Highest?

What does chmod -u do?

Lowest total scrabble score

How to explain what's wrong with this application of the chain rule?

How could a planet have erratic days?

How does a computer interpret real numbers?

What if a revenant (monster) gains fire resistance?

Is there a RAID 0 Equivalent for RAM?

Is aluminum electrical wire used on aircraft?

Can disgust be a key component of horror?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

Sums of entire surjective functions

Plot of a tornado-shaped surface

How to hide some fields of struct in C?

Do the primes contain an infinite almost arithmetic progression?

Extract more than nine arguments that occur periodically in a sentence to use in macros in order to typset

Why does the Sun have different day lengths, but not the gas giants?



Is there a way to make the contents of an element fill the available height before expanding width?


Make a div fill the height of the remaining screen spaceExpand a div to take the remaining widthmake div's height expand with its contentHow to make an inline-block element fill the remainder of the line?How to vertical align an inline-block in a line of text?Make CSS Div height Equal To Contents without changing widthHow to make expandable div with min-heightHow to get inline elements to expand to line-heightFill max-width before max-height?How to make div expand towards top when height modifies?













0















Let's say I have a <div> with a minimum width and a fixed height. If the contents of the <div> gets long, it begins to expand the width to accommodate. However, it will expand the width even if that fixed height leaves plenty of room for more lines of text without making the <div> wider.



Is there a way to make the contents try to spill into the available height first before expanding the width of the <div>?



<div class="container">
Text
</div>

.container
display: inline-block;
height: 3.6em;
min-width: 150px;










share|improve this question


























    0















    Let's say I have a <div> with a minimum width and a fixed height. If the contents of the <div> gets long, it begins to expand the width to accommodate. However, it will expand the width even if that fixed height leaves plenty of room for more lines of text without making the <div> wider.



    Is there a way to make the contents try to spill into the available height first before expanding the width of the <div>?



    <div class="container">
    Text
    </div>

    .container
    display: inline-block;
    height: 3.6em;
    min-width: 150px;










    share|improve this question
























      0












      0








      0








      Let's say I have a <div> with a minimum width and a fixed height. If the contents of the <div> gets long, it begins to expand the width to accommodate. However, it will expand the width even if that fixed height leaves plenty of room for more lines of text without making the <div> wider.



      Is there a way to make the contents try to spill into the available height first before expanding the width of the <div>?



      <div class="container">
      Text
      </div>

      .container
      display: inline-block;
      height: 3.6em;
      min-width: 150px;










      share|improve this question














      Let's say I have a <div> with a minimum width and a fixed height. If the contents of the <div> gets long, it begins to expand the width to accommodate. However, it will expand the width even if that fixed height leaves plenty of room for more lines of text without making the <div> wider.



      Is there a way to make the contents try to spill into the available height first before expanding the width of the <div>?



      <div class="container">
      Text
      </div>

      .container
      display: inline-block;
      height: 3.6em;
      min-width: 150px;







      html css






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 2:30









      derefedderefed

      360212




      360212






















          1 Answer
          1






          active

          oldest

          votes


















          -1














          Going off the assumption that you are not using a front end framework ie: Bootstrap.
          I offer the following solution by adding the max-width attribute.



          .container 
          display: inline-block;
          height: 3.6em;
          max-width: 400px;
          min-width: 150px;






          share|improve this answer


















          • 1





            Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

            – derefed
            Mar 8 at 2:50










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055881%2fis-there-a-way-to-make-the-contents-of-an-element-fill-the-available-height-befo%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          -1














          Going off the assumption that you are not using a front end framework ie: Bootstrap.
          I offer the following solution by adding the max-width attribute.



          .container 
          display: inline-block;
          height: 3.6em;
          max-width: 400px;
          min-width: 150px;






          share|improve this answer


















          • 1





            Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

            – derefed
            Mar 8 at 2:50















          -1














          Going off the assumption that you are not using a front end framework ie: Bootstrap.
          I offer the following solution by adding the max-width attribute.



          .container 
          display: inline-block;
          height: 3.6em;
          max-width: 400px;
          min-width: 150px;






          share|improve this answer


















          • 1





            Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

            – derefed
            Mar 8 at 2:50













          -1












          -1








          -1







          Going off the assumption that you are not using a front end framework ie: Bootstrap.
          I offer the following solution by adding the max-width attribute.



          .container 
          display: inline-block;
          height: 3.6em;
          max-width: 400px;
          min-width: 150px;






          share|improve this answer













          Going off the assumption that you are not using a front end framework ie: Bootstrap.
          I offer the following solution by adding the max-width attribute.



          .container 
          display: inline-block;
          height: 3.6em;
          max-width: 400px;
          min-width: 150px;







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 2:39









          justwhaatiamjustwhaatiam

          115




          115







          • 1





            Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

            – derefed
            Mar 8 at 2:50












          • 1





            Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

            – derefed
            Mar 8 at 2:50







          1




          1





          Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

          – derefed
          Mar 8 at 2:50





          Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up against max-width. What I'm looking for is for it to run up against the current width, then break to a newline and continue, until it fills up the available height. Only after it fills the available height should the width start expanding.

          – derefed
          Mar 8 at 2:50



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055881%2fis-there-a-way-to-make-the-contents-of-an-element-fill-the-available-height-befo%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme