Posts

Showing posts with the label flexbox

Aligning to bottom of List Item using Flexbox

Image
Aligning <span> to bottom of List Item using Flexbox I have a horizontal list for navigation items, and each navigation item can have a "small text" area and a "large" text area, using <span> tags. So for example, the end result should look like this: <span> Notice the last navigation item has no "small text" section, and it aligns with the bottom areas of the navigation. Currently, my code looks like this: navigation.scss .nav { align-items: center; display: flex; height: 100%; margin-left: 5em; ul { display: flex; flex-direction: row; margin-top: auto; li { cursor: pointer; display: flex; flex-direction: column; height: 65px; list-style: none; margin: .25em; margin-bottom: auto; padding: .65em 1.5em 1.5em 1.5em; position: relative; text-align: left; whi...

My position: sticky element isn't sticky when using flexbox

My position: sticky element isn't sticky when using flexbox I was stuck on this for a little bit and thought I'd share this position: sticky + flex box gotcha: position: sticky My sticky div was working fine until I switched my view to a flex box container, and suddenly the div wasn't sticky when it was wrapped in a flex box parent. .flexbox-wrapper { display: flex; height: 600px; } .regular { background-color: blue; } .sticky { position: -webkit-sticky; position: sticky; top: 0; background-color: red; } This is the regular box This is the sticky box </div> JSFiddle showing the problem Does this behavior persist across all browsers that support position: sticky or just one/some? – TylerH Jun 12 '17 at 19:06 position: sticky @TylerH I believe it's all brows...

How do I keep two side-by-side divs the same height?

Image
How do I keep two side-by-side divs the same height? I have two divs side by side. I'd like the height of them to be the same, and stay the same if one of them resizes. I can't figure this one out though. Ideas? To clarify my confusing question, I'd like both boxes to always be the same size, so if one grows because text is placed into it, the other one should grow to match the height. Some content! Some content! Some content! Some content! Some content! Some content! </div> How did you put them "side by side"? Using float ? – MvanGeest Jun 8 '10 at 13:41 float Do you want that if one of them is getting bigger, than the other one will stay the same height size? – Wai Wong Jun 8 '...

flex item overflows container due to long word even after using word-wrap

flex item overflows container due to long word even after using word-wrap question somethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomething question somethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsomethingsometh...