The first image is way wider than the other two because of the space taken up by the <p></p> element.
How do I ensure that the p wraps at the width of the flex box?
I have a working bootply.
/* CSS used here will be applied after bootstrap.css */
body { background-color: rgba(20,10,10,.4); }
div.container { background-color: white; }
#media (min-width: 1380px) {
div.container {
width: 1400px; } }
div.container section {
display: flex;
align-items: stretch;
flex-wrap: wrap;
justify-content: space-between;
}
div.container section div img {
width:100%;
}
div.container section div p {
width: 100%;
}
div.container section div {
border: 1px solid black;
flex-grow:1;
}
div.container section div+div {
margin-left:4rem;
}
div.container section h1 {
color: #8f825a;
font-size: 2.7rem;
text-transform: none;
}
div.container section h2 {
color: #8f825a;
font-size: 1.8rem;
}
<div class="container">
<h3>H3</h3>
<h2>H2</h2>
<section>
<div>
<img src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAKAAD/4QMpaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4b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q1ZKUTxcbErTENPwN65zq52P47k2rssoXibcPwSrrazco7NXoiUjF4ZMfApjqkm9DXWsLXUi2TVtBhupGTkcXHlTmqnyNDsIYOJb4VdmYOR8RemtUepghaslZrya4DScqH2LacLa+p6HJg36MguIurKTHKxcBZEqpT9Tfi+KrjWqTfibqVVFCJyTFtY/0KBcNJrwRskCooWCi7DrirXoXCZQIWhGzKm0+4RdCDQpj6gqvxAt3V8UJ5KruU2wq3VSVZ8G5JJwBqeaqcdyF+SqqYf3FOLDWi1bbLNinRsKspemVSoZXfj4/AzZcbxTbF+ZvUePJmcO0AYeTyW5VccNfvHObtbVnqMeRWUWUGXl4aZPy6PyIljz/AFK7U1NluNdPbRT9SvJxL461yX7uGis4XGwWryMTjT3KL8QOu+HXHbHZP9+n8yALi/2btQ62+5kL4ciTqq22+TADNzHSbp2WWEq0soWnpY6Vz5G3kVlpH5WAHH9Hb9lnsZVWUnPkZM/G5Vtdr18EwA1Plm/XtCmLkcZu1aWsp6bWdLjZst6647Lzq0AGuGOfbReWotVv7COPjL+FqfoAF4TlzX8bmpk3VTa8jq047qujABMOcWbG+qYvafgwAqcmqWXZj228GAFQttvBhtt4MAANtvBjVX4MAANtvBjdLeDAAI7beDGq28GAAGxvsw2PwYAAtlvBhst4MACDZbwYbLeDAAE8bfZi9h+DACg9l+DD2n4P7gAA9t+DI3Tr1q39gABhzPkNxSr+npZdgw5/3/5QAijPw8mVQm6/YPHw71SVm3H0ACok+JeZU/cxU416v1S/JAAGT9Pky5lTY1Ssu1oevkW8/h2zYXWlXK1WgABm4/6jkPHvpataWq7SnNtQAAP/2Q==">
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<p>foo dsalkfjds lakfjdlsk fksdalj fldsfjad slkafjdslk fdsajflkds aflkdjsaflkdsjfdslkafjdlks fjlkdsj</p>
</div>
<div>
<img src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAKAAD/4QMpa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9Hb9lnsZVWUnPkZM/G5Vtdr18EwA1Plm/XtCmLkcZu1aWsp6bWdLjZst6647Lzq0AGuGOfbReWotVv7COPjL+FqfoAF4TlzX8bmpk3VTa8jq047qujABMOcWbG+qYvafgwAqcmqWXZj228GAFQttvBhtt4MAANtvBjVX4MAANtvBjdLeDAAI7beDGq28GAAGxvsw2PwYAAtlvBhst4MACDZbwYbLeDAAE8bfZi9h+DACg9l+DD2n4P7gAA9t+DI3Tr1q39gABhzPkNxSr+npZdgw5/3/5QAijPw8mVQm6/YPHw71SVm3H0ACok+JeZU/cxU416v1S/JAAGT9Pky5lTY1Ssu1oevkW8/h2zYXWlXK1WgABm4/6jkPHvpataWq7SnNtQAAP/2Q==">
<h1>Heading 1</h1>
<h2>Heading 2</h2>
</div>
<div>
<img src="">
<h1>Heading 1</h1>
<h2>Heading 2</h2>
</div>
</section>
</div>
Instead of flex-grow: 1 use flex: 1:
div.container section div {
flex: 1;
}
revised demo
By using flex-grow: 1 by itself, you're leaving the two other flexibility properties at their default values. Namely, flex-shrink: 1 and flex-basis: auto (content width, in row-direction).
By using the flex property you are defining all three properties: flex: 1 is equivalent to:
flex-grow: 1
flex-shrink: 1
flex-basis: 0 (initial main size 0, not auto)
This allows your flex items to be equal width, regardless of their initial main size.
Other answers here are telling you to add flex-basis: 0 to your code. That effectively does the same thing. The spec recommends you use the flex property, however:
7.2. Components of
Flexibility
Authors are encouraged to control flexibility using the flex shorthand
rather than with its longhand properties directly, as the shorthand
correctly resets any unspecified components to accommodate common
uses.
For a complete explanation of the difference between flex-basis: auto and flex-basis: 0, see this post: Make flex-grow expand items based on their original size
You can add flex-basis: 30%; to div.container section div:
http://www.bootply.com/moTWJ5T9dB
In Your Example just add - flex-basis: 0; to all divs like this:
div.container section div {
border: 1px solid black;
flex-grow: 1;
flex-basis: 0;
}
This results that the divs get flexible, means they receive the specified proportion of the remaining space. E.g. They all have the same width.
Related
JS Fiddle
I have two parent boxes positioned next to each other with flex box, inside of them I have another flex box so the h2 and p can sit side by side.
I've not set a width of the parent boxes and ideally I do not want to.
Why is my text content wrapping when there is space for each flex box to expand? In the example the title is wrapping after Is - why can't the h2 expand so This Is Title A appears all on one line?
.container {
background: grey;
display: flex;
}
.container>div {
align-items: center;
display: flex;
}
h2 {
flex-basis: 40%;
}
p {
flex-basis: 60%;
}
<div class="container">
<div>
<h2>This Is Title A</h2>
<p>Content.</p>
</div>
<div>
<h2>This Is Title B</h2>
<p>Content.</p>
</div>
</div>
The problem is that percentage lengths use the parent container for reference, and that's missing in your code. The parent of the h2 and p items don't have a defined width.
Once you define a width on the parent (which I know you don't want to do), the problem is resolved. Otherwise, use another unit of length, white-space: nowrap, or some other compromise.
10.2 Content width: the width
property
<percentage>
Specifies a percentage width. The percentage is calculated with respect to the width of the generated box's containing
block. If the containing block's width depends on this element's
width, then the resulting layout is undefined in CSS 2.2 (and 2.1).
Add flex-grow: 1 and a flex-shrink: 0 to your h2. This will prevent the h2 of shrinking. Also, since you are limiting the relative maximum the h2 can grow (40%) it would break anyway.
EDIT:
flex-grow/shrink was missing in the .container>div. Add the rule flex: 1 1 auto; so they expand evenly to fill all the width.
.container {
background: grey;
display: flex;
}
.container>div {
align-items: center;
display: flex;
flex: 1 1 auto;
}
h2 {
flex: 1 0 40%;
white-space: nowrap:
/*flex-basis: 40%;*/
}
p {
flex-basis: 60%;
}
<div class="container">
<div>
<h2>This Is Title A</h2>
<p>Content.</p>
</div>
<div>
<h2>This Is Title B</h2>
<p>Content.</p>
</div>
</div>
I'm using flexbox to make my footer stick to the bottom, and for the most part it's working. My problem is, I need the content to be within a specified width, that I set with max-width and center with margin-left:auto; and margin-right:auto;. When I activate flexbox, the contents are squished by the margin-left and margin-right rules, and do not take up the space defined by max-width. I would like to know why this is happening and how to get my footer to look how I want it to look.
Here is how I want my footer to look:
And here is how flexbox is affecting it:
body {
display: flex;
flex-direction: column;
min-height: 100%;
}
div#content {
flex: 1 0 auto;
}
footer {
flex: 0 0 auto;
max-width: 67.5rem;
margin-left: auto;
margin-right: auto;
padding-left: 1.25rem;
padding-right: 1.25rem;
padding-bottom: 1.875rem;
padding-top: 3.5rem;
}
<body>
<header>...</header>
<div id="content">...</div>
<footer>
<span id="left">left text</span>
<span id="mid">right text url#mail</span>
<span id="icons">...</span>
</footer>
</body>
If I change max-width to width then it works, but then when I test it in my browser using the device-mobile setting to see how it would look on a mobile device, the width property makes the footer too big and messes up the content. If I take out the margin-left and margin-right properties, then my footer looks like this:
As you can see it's no longer centered. I can't use the flex-basis property because that only affects the height of the footer. Please help.
Edit
Here is a snippet with margin-left and margin-right taken out and replaced with display:flex; and justify-content:space-around;. Be sure to click "Full page" to view with a larger viewport.
body {
display: flex;
flex-direction: column;
min-height: 100%;
}
div#content {
flex: 1 0 auto;
}
footer {
flex: 0 0 auto;
max-width: 67.5rem;
padding-left: 1.25rem;
padding-right: 1.25rem;
padding-bottom: 1.875rem;
padding-top: 3.5rem;
display: flex;
justify-content: space-around;
}
<body>
<header>...</header>
<div id="content">...</div>
<footer>
<span id="left">left text</span>
<span id="mid">right text url#mail</span>
<span id="icons">...</span>
</footer>
</body>
This can be done easily with justify-content: space-between;, but looking at your code I feel you may misunderstand a bit how Flexbox itself works. You want your footer to act as a flex container so you can manipulate the child spans as well.
Consider checking out freeCodeCamp's Flexbox Challenges to get a better idea how Flexbox works.
EDIT: CodePen now reflects what OP was meaning to immitate.
Here's a CodePen to play around with.
What this does is makes your footer both a child and container.
First your body becomes a container to allow the main content to grow to fill the space pushing your footer to the bottom of the page. The flex-direction is set to column to flow vertically.
You create a wrapper for your footer, because currently your footer is in the body container which is set to flex-direction:column; where in this case, you want the direction to be row to style horizontally. By default display:flex; will assume you wanted row so direction doesn't need declared. We then justify-content to the center so no matter the width the footer itself will be centered.
You treat your <footer> as both a child and container. As a child we tell it not to grow or shrink and set the basis to auto. As a container, we tell it to distribute space-between its children which allows a consistently equal amount of space between the left & right spans.
body {
display: flex;
height: 100%;
flex-direction: column;
}
.main {
flex: 1 0 auto;
border: 1px solid #000;
}
.wrapper {
display: flex;
justify-content: center;
}
footer {
flex: 0 0 auto;
display: flex;
margin: 1em;
width: 80%;
border: 1px solid #000;
justify-content: space-between;
}
<body>
<div class="main">
<h1>Hello Flex</h1>
<p>This is Flexbox</p>
<h1>Hello Flex</h1>
<p>This is Flexbox</p>
</div>
</body>
<div class="wrapper">
<footer>
<span id="left">left text</span>
<span id="mid">right text url#mail</span>
</footer>
</div>
I gave up trying to get this to center with flexbox. Instead I used the calc function to calculate the padding-left and padding-right of my <footer> tag. Here is what I came up with (I'm using 47.5rem instead of 67.5rem because I think it's easier to see the behavior).
body {
display: flex;
flex-direction: column;
min-height: 100%;
}
div#content {
flex: 1 0 auto;
}
footer {
flex: 0 0 auto;
display: flex;
align-items: center;
padding-left: calc(((100vw - 47.5rem)/2) + 1.25rem);
padding-right: calc(((100vw - 47.5rem)/2) + 1.25rem);
padding-bottom: 1.875rem;
padding-top: 3.5rem;
}
#left {
flex: 1;
order: 1;
}
#mid {
flex: 0 0 auto;
order: 2;
}
#icons {
order: 3;
}
<body>
<header>...</header>
<div id="content">...</div>
<footer>
<span id="left">left text</span>
<span id="mid">right text url#mail</span>
<span id="icons">...</span>
</footer>
</body>
Currently, I'm trying to make a list. On the left side images which fit into my "display flex layout" and resize on all browsers. My "flex-grow layout" list 1 for the image and 3 for the description. Without images, everything is fine, but with my image (100% width) it does not fit into the 1/3 of the row ...
Does anybody know a solution?
#main {
height: 100px;
border: 1px solid #c3c3c3;
display: -webkit-flex; /* Safari */
display: flex;
}
#main div:nth-of-type(1) {-webkit-flex-grow: 1;}
#main div:nth-of-type(2) {-webkit-flex-grow: 3;}
#main div:nth-of-type(1) {flex-grow: 1;}
#main div:nth-of-type(2) {flex-grow: 3;}
#main img { width: 100% }
<div id="main">
<div style="background-color:coral;"><img src="http://www.der-eyecatcher.de/wp-content/uploads/2016/02/Lampe-silber-Schirm_1.jpg"></div>
<div style="background-color:lightblue;">Description</div>
</div>
<hr>flex-grow without Image<hr>
<div id="main">
<div style="background-color:coral;"></div>
<div style="background-color:lightblue;">Description</div>
</div>
Thank you
Simon
You have the image container – the flex item div – set to flex-grow: 1. That's fine.
Except the default value of flex-basis is auto (spec).
So, you're telling the item that it's initial main size (i.e., flex-basis) should be the size of its content (the image). That's exactly what's happening. The item takes the natural size of the image.
Add this to your code:
flex-basis: 0
OR, better yet, this:
flex: 1
which is short for:
flex: 1 1 0
which is short for:
flex-grow: 1
flex-shrink: 1
flex-basis: 0
From the spec:
7.2. Components of
Flexibility
Authors are encouraged to control flexibility using the flex shorthand
rather than with its longhand properties directly, as the shorthand
correctly resets any unspecified components to accommodate common
uses.
For an explanation of the difference between flex-basis: auto and flex-basis: 0, see this post:
Make flex-grow expand items based on their original size
#main {
height: 100px;
border: 1px solid #c3c3c3;
display: flex;
}
/* adjustment here */
#main div:nth-of-type(1) {
flex: 1;
}
#main div:nth-of-type(2) {
flex-grow: 3;
}
#main img {
width: 100%;
height: auto;
}
<div id="main">
<div style="background-color:coral;"><img src="http://www.der-eyecatcher.de/wp-content/uploads/2016/02/Lampe-silber-Schirm_1.jpg"></div>
<div style="background-color:lightblue;">Description</div>
</div>
<hr>flex-grow without Image
<hr>
<div id="main">
<div style="background-color:coral;"></div>
<div style="background-color:lightblue;">Description</div>
</div>
I'm having a problem with what I assumed would be a relatively simple CSS layout.
I want...
a footer at the bottom (fixed height)
a nav bar on the left side (fixed width)
an outer content pane on the right side (dynamic size)
And in the content pane...
a ribbon on the top (fixed height)
an inner content div (dynamic size)
I'm trying to use flexbox for this, as it seems to be the best option at present (grid is too unstable and not well supported).
The problem is that my inner content div is (in reality) several layers deep inside the outer content div. This means I cannot be using flexbox directly on it, as flex is a direct parent-child relationship (and I'm a few layers deep, as per the comment in the code).
Ideally I want to do it as my below code, however as you can see, the inner div is flowing OUTSIDE the containing outer div's box, behind the footer, and then outside the entire container (for the height of the ribbon div).
It would seem "height: 100%" just does not deal with it properly... but I can't have every item in the chain from "content" to "inner" set up with flexbox - as I literally do not have control over this. (I'm using angular, and it generates a bunch of tags every layer, and they're dynamically named).
body {
margin: 0px;
padding: 0px;
}
.container {
display: flex;
flex-direction: column;
height: 100%
}
.body {
display: flex;
flex: 1;
}
.content {
background-color: blue;
flex: 1;
}
.ribbon {
background-color: orange;
height: 99px;
}
.inner {
overflow: auto;
height: 100%;
}
.footer {
background-color: lime;
flex: 0 0 38px;
}
<body>
<div class="container">
<div class="body">
<div class="content">
<div class="ribbon">STUFF<br>BLAH</div>
<!-- there is actually a bunch of other stuff in between "content" and "inner"-->
<div class="inner">
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
</div>
</div>
</div>
<div class="footer">footer</div>
</div>
</body>
I have made a plunker to demonstrate the problem...
https://plnkr.co/edit/zzFHhLK7nef1VNQkwp7U?p=preview
Any help would be greatly appreciated!
What I recommend is making a second layer of flexbox, by adding display: flex and flex-direction: column to .content, in addition to its existing flex: 1:
.content {
flex: 1;
display: flex;
flex-direction: column;
}
Considering flexbox is a parent-child relationship, you'll need to add flex: 1 to anything that is a direct child of .content, which can be done by using the child combinator >:
.content > * {
flex: 1;
}
In addition to this, you'll need to set a max-height on the .ribbon:
.ribbon {
max-height: 99px;
}
Combined together, this can be seen working in the following example:
body {
margin: 0px;
padding: 0px;
}
.container {
display: flex;
flex-direction: column;
height: 100%
}
.body {
display: flex;
flex: 1;
}
.content {
background-color: blue;
flex: 1;
display: flex;
flex-direction: column;
}
.content > * {
flex: 1;
}
.ribbon {
background-color: orange;
height: 99px;
max-height: 99px;
}
.inner {
overflow: hidden;
height: 100%;
}
.footer {
background-color: lime;
flex: 0 0 38px;
}
<body>
<div class="container">
<div class="body">
<div class="content">
<div class="ribbon">STUFF<br>BLAH</div>
<!-- there is actually a bunch of other stuff in between "content" and "inner"-->
<div class="inner">
content<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br> content
<br>content<br>content<br>content<br>content<br>content<br>content<br>content<br>
</div>
</div>
</div>
<div class="footer">footer</div>
</div>
</body>
Hope this helps! :)
My issue is that I have a section within the article that I made a flexbox, and when I reduce the size of the browser those 3 elements in that flexbox will overlap. Any tips?
body {
display: flex;
flex-direction: column;
}
header {
background: blue;
}
main {
display: flex;
flex-direction: row;
flex: auto;
}
article {
flex: 2;
overflow-y: auto;
background: red;
}
aside {
flex: 1;
overflow-y: auto;
background: green;
}
.test {
display: flex;
flex-direction: row;
flex: auto;
align-items: stretch;
background: pink;
}
<body>
<header>
Test
</header>
<main>
<article>
<section>
test
</section>
<section class="test">
<div>
div one
</div>
div two
<div>
div three
</div>
<div>
</div>
</section>
</article>
<aside>
aside
</aside>
</main>
<footer>
</footer>
</body>
http://jsfiddle.net/zLmcyjy6/
Try adding flex-wrap: wrap to the flex container. Flex items do not wrap by default.
In reference to your website (I didn't use your fiddle demo, which has different code), each of the non-wrapping elements is a <section> child of <section class="other">, which is a row-direction, wrap-enabled flex container.
Each <section> flex item has a flex: 1 applied. This translates to:
flex-grow: 1
flex-shrink: 1
flex-basis: 0
With flex-basis set to zero, the initial main size of the flex item is 0, and the width could shrink to that degree, so there's no opportunity to wrap.
I would suggest changing flex-basis: 0 to something like flex-basis: calc(33% - 2em) (i.e., width minus approx. margin, border, padding), for wider screens. So flex: 1 1 calc(33% - 2em).
And then for smaller screens, using a media query, set flex-basis to something like:
#media screen and ( max-width: 500px ) {
.fitness, .education, .pastimes {
flex-basis: 100%;
display: flex; /* optional; for nicer alignment */
flex-direction: column; /* optional; for nicer alignment */ }
}
Alternatively, if you wanted to avoid using media queries, you could set a fixed value to flex-basis which would enable wrap, as well. Something like flex: 1 0 200px.