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?
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
add a comment |
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
add a comment |
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
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
html css
asked Mar 8 at 2:30
derefedderefed
360212
360212
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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;
1
Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up againstmax-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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
1
Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up againstmax-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
add a comment |
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;
1
Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up againstmax-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
add a comment |
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;
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;
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 againstmax-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
add a comment |
1
Correct, there are no frameworks involved. As for the suggestion, this still expands the width until it runs up againstmax-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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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