Kentucky Derby முடிவுகள்

Kentucky Derby-யில் வென்றவர் யார்?

Fixed-Height Cards: More Fragile Than They Look | CSS-Tricks

Fixed-Height Cards: More Fragile Than They Look | CSS-Tricks


Fixed-height cards often feel like a safe choice. A designer hands you a mockup where every card aligns perfectly in a grid. The titles are short, the excerpts fit neatly, and the layout looks stable across the entire page. So you implement the design exactly as specified and ship it.

Everything works until the content changes. An editor updates the copy, a translation adds longer words, and some users bump their default font size, especially those with low vision or digital eye strain, just to make things easier to read.

I ran into this while building a “Recent Articles” section for a blog. The design assumed relatively short English titles, so everything fit comfortably inside the fixed height.

The layout looked solid at first glance:

Fixed-Height Cards: More Fragile Than They Look | CSS-Tricks
Initial design

But once the content changed, the cracks started appearing:

A three-column layout of cards. The content contained in the third card is longer than the first two cards, resulting in its content overlapping with elements below it.

Translating the content to French made things worse:

Language issues

German translations pushed the layout even further:

A three-column layout of cards. The heading in the first card is longer than the headings in the other two cards, resulting in content below the headings overlapping with elements below them.
More layout failures

What once looked like a stable component turned out to depend on a fragile assumption: that the content would always stay within a fixed height.

Here’s a demo of the layout:

Fixed-Height Layouts Look Fragile

In the design specifications, the pixel dimensions were exact, and you know that cards align more cleanly when they have the same vertical rhythm and equal size, which creates in our mind a sense of order that I and the designer kind of trusted.

So, I set:

.card__title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__excerpt {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

But surprisingly, the behavior changed as soon as the font settings changed. I increased the browser’s default text size and realized that it introduced pressure inside the cards. My text blocks grew, but the container remained the same, and elements began competing for the same space.

Normally, a block element simply grows with its content. But the moment I set that height, I broke that relationship. The browser doesn’t treat this as a problem; it just resolves the conflict the only way it can, by either letting content overflow or clipping it.

In the original version of the layout, I just bluntly hid those problems with overflow: hidden.

To make the problem visible, we can remove the safety net:

.card__title {
  display: -webkit-box;
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 8px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  /* overflow: hidden; */
}

.card__excerpt {
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 10px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

Without overflow: hidden, the failure is no longer subtle. The content stops clipping and starts spilling out like groceries from a torn bag. Some excerpts sit right on the tags, and everything was breaking once we stopped hiding the pressure inside the card.

A three-column layout of cards. The first cards heading is much longer than the other two cards, causing the heading to overlap with the content beneath it.
Removing overflow: hidden reveals the structural tension instead of masking it.

Unfortunately, the browser has no way to reconcile those competing instructions except by letting elements collide.

Removing the Fixed Height

Removing the constraints that held this layout together reveals where the real problem lives. Fixed heights, absolute positioning, and grid alignment were all trying to control the same thing.

Absolutely Positioned Actions: Removed From Flow

Up to this point, the fixed height looks like the main culprit to me. But it isn’t acting alone; the actions at the bottom of the card were absolutely positioned:

.card__actions {
  position: absolute;
  inset: 0 14px 14px;
}

This feels like a clean solution; the actions stay pinned to the bottom of the card no matter how long the content is.

In a typical block layout, a container’s height is determined by the combined contribution of its in-flow children.

I’m sure you have seen how absolutely positioned elements behave. The browser still renders them, even though they no longer contribute to the parent’s intrinsic height. Visually, the actions belong to the card, structurally, the layout ignores them.

To compensate, we reserved space manually:

.card__body {
  padding-block-end: 14px;
}

This padding is really just an estimate. The moment the font size increases, buttons wrap, or translations make the text longer, the estimate stops being reliable.

Instead of trying to predict how much space the actions might need, we can let the browser calculate it.

Here is the same layout without absolute positioning:

The change is small, but the shift in behavior is quite noticeable. Even with the fixed height still in place, the internal tension shrinks because the layout is no longer working against itself.

This is the first structural improvement. The card still has an extrinsic height constraint, so the layout isn’t fully flexible yet.

A three-column layout of cards. The heading contained in the second card is shorter than the other two cards, resulting in the card bottom borders being uneven and overlapping the content.
Removing absolute positioning reduces internal layout tension, even before removing the fixed height.

There is an Illusion of Control

If fixed heights act like ceilings, line clamping acts more like a mute button. In the original component, I clamped the title and the excerpt:

.card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

Clamping feels reassuring to me at that time because it limits drift and keeps cards visually aligned. But in practice, that flips the relationship.

To really see this more clearly, let’s remove clamping while keeping everything else the same. This version is identical to the previous demo except that I have removed all clamping from .card__title and .card__excerpt but left the overflow so that we can clearly see what happens.

A three-column layout of cards. The first card's content is shorter than the other two cards, resulting in its border overlapping the content.
Removing clamping exposes how much content the layout was suppressing.

Without clamping, the tension inside the component becomes obvious. You see how German card grows taller, and the excerpt wraps naturally. What this really shows us is that a stable layout shouldn’t rely on overflow: hidden. If a layout only works because content is being suppressed, it’s probably fragile.

Up to this point, almost every failure we’ve seen traces back to a single decision:

.card {
  height: 375px;
}

This one line may look innocent to you, but it overrides the browser’s default sizing behavior.

At some point, the simplest question becomes unavoidable: So what happens if we just… stop? Remove the height entirely and let the browser do its thing?

Let’s remove the fixed height while keeping the rest of the layout intact. Clamping can stay in place since we want to compare behaviors.

Once I restored intrinsic sizing inside the card, the alignment problem really became a grid issue, which brings us to our next refinement.

Let the Grid Handle Equal Heights

Fixed heights felt appealing. But having equal heights doesn’t actually mean fixing the heights manually. The grid can handle that alignment for us without me imposing hard boundaries on each component.

Sometimes, the fix is surprisingly small. Removing align-items: start lets the grid items stretch naturally, and switching to a more flexible column definition helps the layout adapt better across different screen sizes.

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

See how the same layout uses intrinsic card heights and flexible grid tracks:

A three-column layout of cards. The content in the second card is shorter than the content in the first and third cards.
Grid normalizes alignment without imposing arbitrary height constraints.

To make the button nicely align like we had initially, instead of positioning and reserving space manually:

.card {
  padding: 14px;
  position: relative;
}

We turn the card into a vertical layout:

.card {
  display: flex;
  flex-direction: column;
  padding: 14px;
}

We’re not going to go deep on flexbox here, as Kevin Powell has a great article on exactly that. But it’s worth knowing what’s happening. Turning the card into a flex container with flex-direction: column lines everything up vertically from top to bottom.

The next step is removing the artificial space that was holding room for the actions:

.card__body {
  padding-block-end: 56px;
  padding-block-start: 10px;
}

That padding was a guess; it only worked as long as the content stayed predictable. Instead, we let the body expand naturally:

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-block-start: 10px;
}

The flex: 1 tells the body to take up whatever space is left after the image, and the actions have taken what they need.

If the tags need a bit of breathing room, a simple margin does the job:

.card__tags {
  margin-block-end: 10px;
}

We get a card that looks just as aligned as in our original page, but now the alignment comes from layout flow, not from forcing the height.

A three-column layout of cards that contain an image, heading, blurb, tags, and button.

Using clamp() for Fluid Typography

Fluid typography with clamp() can make titles scale more smoothly across viewport sizes:

.card__title {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

If you want to know more about clamp(), Pedro Rodriguez’s article on scaling font size with CSS clamp() is a good read.

Declaring clamp(1rem, 2vw, 1.25rem) allows the title to scale with the viewport while staying within a safe range. The font size can grow or shrink with the viewport (2vw) but will never go smaller than 1rem or larger than 1.25rem.

Designing for Failure

None of the problems I mentioned earlier in this layout appeared while I was building it. The problems appeared only when some conditions changed. Sometimes an image didn’t load, which changed the vertical balance of the card. And as the viewport narrowed, the text had to wrap more aggressively.

If you want to know whether a component will hold up with real content, try putting it under extreme conditions. A few simple tweaks are enough to reveal where the layout starts to break or fall apart:

  • Increase the browser’s default font size to see how it behaves.
  • Enable text-only zoom instead of page zoom to observe the difference.
  • Replace a title with a single unbroken string or simulate other languages with longer words.
  • Simulate a missing image.
  • Shrink the viewport until the text starts wrapping aggressively.

Rather than explaining things abstractly, we can introduce them directly into the intrinsic-height version of the card.

Stress Test Mode

From the intrinsic-height version, we can add a simple toggle that simulates a few content stress cases.

Add this button inside the .demo-toolbar:

Add the following script, too:

const stressBtn = document.querySelector("#toggleStress");

stressBtn.addEventListener("click", () => {
  document.body.classList.toggle("stress");
});

This script simply listens for clicks on the button and adds or removes a stress class on the . That class acts as a switch that turns the stress-test styles on and off.

And add these styles:

body.stress .card:nth-child(1) .card__title::after {
  content: "ExtremelyLongUnbrokenStringWithoutAnySpacesToTestOverflowBehavior";
}

body.stress .card:nth-child(2) .card__excerpt {
  font-size: 1.1rem;
}

body.stress .card__media img {
  display: none;
}

These styles simulate a few common layout stress cases. The first card gets an unbroken string to test overflow behavior. The second increases text size to mimic larger default font settings. The rule on .card__media img hides media entirely to simulate a missing or failed image load.

This stability isn’t coming from the defensive rules I added at the end. It comes from the earlier structural decisions. Once fixed heights and out-of-flow positioning were removed, the component could adapt naturally to whatever content it receives.

Once you start relying on intrinsic sizing, you stop worrying about every possible string length or font setting. If the content gets longer or the text size changes, the browser can handle it. Most layout problems start when we take that flexibility away.

So, What Grows and What Doesn’t?

The original card failed for a simple reason: it depended on assumptions that were never stated. The title was supposed to fit in two lines, the excerpt was supposed to fit in four and buttons were supposed to stay on one line. Translations were supposed to stay “about the same length” and users were supposed to keep default text settings. None of that was enforced. They were simply guesses.

Those assumptions quietly made their way into my CSS. As long as the content stayed within those boundaries, everything kind of looked stable. But the moment it drifted, the layout started responding badly to the conflict.

When I rebuilt this component, the first thing I did was remove those hidden dependencies. There’s no fixed pixel ceiling anymore, no padding buffer that needs me to constantly tweak, and no truncation acting as a safety net to keep the layout from breaking.

Truncation can still be a deliberate design choice. But you shouldn’t truncate just to keep the layout from collapsing. When that happens, the component is already under strain.

The final demo shows that idea in practice. It loads stressed content by default, with longer translated text, wrapped tags, and a missing image, so that you can see how the component behaves under real conditions rather than ideal ones.

Each card grows as needed, and the grid keeps alignment without hiding overflow or relying on defensive spacing.

I Think Fixed Heights Are Still Useful

Working through this layout changed how I think about fixed heights. I still use them when they make sense, and I still clamp text when truncation is intentional. But whenever I find myself trying to control how content flows inside a component, it’s usually a sign that the layout needs to be reconsidered. Most of the time, letting the browser handle the sizing leads to a more resilient result.

Leave a Reply

Your email address will not be published. Required fields are marked *

肯塔基德比结果 Cherie Devaux Golden Tempo 赛马 Golden Tempo 谁赢得了肯塔基德比 2026年肯塔基德比结果 肯塔基德比冠军 骑师 Jose Ortiz Jose Ortiz Golden Tempo 赔率 肯塔基德比历届冠军 德比结果 谁拥有 Golden Tempo 德比冠军 2026年普利克尼斯锦标赛 Golden Tempo 马主 2026年德比结果 赛马 Golden Tempo 赔率 Cherie Devaux 的丈夫 哪匹马赢得了肯塔基德比 谁赢得了肯塔基德比 Daisy Phipps Pulito Golden Tempo 的骑师 谁拥有赛马 Golden Tempo Phipps 马房 Golden Tempo 的赔率是多少 谁赢得了德比 肯塔基德比直播 今天谁赢得了肯塔基德比 肯塔基德比的喜悦 肯塔基 肯塔基德比赛程多长 Golden Tempo 与肯塔基德比 德比历届冠军 肯塔基德比完赛情况 2026年肯塔基德比直播 肯塔基德比包含多少场比赛 肯塔基德比回放 赛马 Danon Bourbon 今日赛马赛事 Danon Bourbon 谁赢得了2026年德比 上一位三冠王得主 2026年肯塔基德比今日结果 Golden Tempo 的练马师 肯塔基德比开赛时间 2026年肯塔基德比冠军 赛马 Golden Tempo 血统 Irad Ortiz Jr. Golden Tempo 的马主 2026年肯塔基德比完赛情况 肯塔基德比最终结果 谁赢得了2025年肯塔基德比 Cheri Devaux Vincent Viola 肯塔基德比冠军得主 是哪匹马赢得了肯塔基德比 2026年普利克尼斯锦标赛何时举行 普利克尼斯锦标赛 肯塔基德比女性练马师 赛马 Golden Tempo 的马主 练马师 Cherie Devaux 谁赢得了德比 今日德比结果 德比直播 肯塔基德比结果 Cherie Devaux 的年龄 今日赛马比赛 2026年肯塔基德比回放 Irad Ortiz 德比完赛情况 肯塔基德比完整结果 肯塔基德比排名 第152届肯塔基德比 2026年肯塔基德比完赛顺序 德比完赛顺序 练马师在肯塔基德比中能获得多少奖金德比大赛 2026年普瑞克尼斯锦标赛 Cherie Devaux 的子女 肯塔基德比冠军 Daisy Phipps 肯塔基德比直播 肯塔基德比持续多久 肯塔基德比首位女性练马师 2026年德比赛果 “Golden Tempo”的马主是谁 今天谁赢得了德比大赛 2026年肯塔基德比在线直播 2026年肯塔基德比完整赛果 2026年肯塔基德比视频 “Golden Tempo”的马主们 “Albus”参加肯塔基德比 谁赢得了2025年肯塔基德比 “Golden Tempo”的赔率 肯塔基德比冠军能获得什么奖励 肯塔基德比的赛马跑得有多快 肯塔基德比的骑师们 “Ocelli”参加肯塔基德比 骑师 Jose Ortiz 肯塔基德比在哪里举行 赛马运动 “Golden Tempo”今天的赔率 肯塔基德比中的女性骑师 肯塔基德比的赛程长度 2026年肯塔基德比完赛情况 “So Happy”在肯塔基德比中获得了第几名 2026年肯塔基德比“三连胜”赔付金额 肯塔基德比现场直播 Ortiz 兄弟骑师组合 2026年肯塔基德比“三连胜”赔付 骑师 Renegade 普瑞克尼斯锦标赛 “So Happy”在肯塔基德比中获得了什么名次 “Six Speed”参加肯塔基德比 2026年肯塔基德比排名 肯塔基德比完赛顺序 2026年肯塔基德比直播流 Jose Ortiz 策骑的德比赛马 2026年肯塔基德比名次排列 2026年肯塔基德比完赛顺序 肯塔基德比完赛排名 Jose Ortiz 的兄弟 St Elias 马房 谁赢得了肯塔基德比?佛罗里达美洲豹队老板 Golden Tempo 的号码 Cherie Devaux 的家人 Golden Tempo 的骑师 Golden Tempo 的参赛号码是多少 Golden Tempo 在肯塔基德比的骑师 Golden Tempo 的派彩金额 肯塔基德比的比赛结果 肯塔基德比结果 Golden Tempo 的血统 2026年肯塔基德比冠军 肯塔基德比冠军能赢得多少奖金 肯塔基德比21号赛马 肯塔基德比女性骑师 肯塔基德比结果 2026年肯塔基德比最终结果 谁赢得了2026年德比 肯塔基德比的赛程长度 23赔1的赔率派彩 肯塔基德比官方结果 2026年肯塔基德比直播观看 Daisy Pulito Jose L. Ortiz 肯塔基德比的结果 2026年肯塔基德比与 Golden Tempo 肯塔基德比与 Golden Tempo 肯塔基德比派彩金额 Golden Tempo 在肯塔基德比的赔率 肯塔基德比结果 今日肯塔基德比冠军 肯塔基德比完赛名次 肯塔基德比奖金收入 今日肯塔基德比结果 2026年肯塔基德比女性骑师 2026年肯塔基德比比赛回放 谁赢得了肯塔基德比 谁刚刚赢得了肯塔基德比 Golden Tempo 的赛马号码 2026年肯塔基德比排名 女性骑师 Golden Tempo 的赔率是多少 肯塔基德比的最快纪录时间 谁赢得了2026年肯塔基德比 Golden Tempo 的赔率是多少 肯塔基德比中有女性骑师参赛吗 肯塔基德比历届冠军名单 肯塔基德比比赛结果 肯塔基德比冠军能获得什么奖励 Golden Tempo 赛马的主人 肯塔基德比最终排名 谁赢得了肯塔基德比 Golden Tempo 的赔率 肯塔基德比的冠军们 肯塔基德比结果 2026年肯塔基德比结果 谁拥有 Golden Tempo 这匹马 肯塔基德比冠军们 肯塔基德比完赛时间 2026年肯塔基德比中的女性骑师 Golden Tempo 的赔率是多少 Jose Ortiz 与肯塔基德比 肯塔基德比“三连胜”派彩历史 Golden Tempo 的练马师 肯塔基德比比赛视频 2026年肯塔基德比完整结果 第一届肯塔基德比是何时举办的 今日肯塔基德比结果 Jose奥尔蒂斯骑师兄弟 肯塔基德比参赛马匹编号 2026年德比大赛成绩 “神奇迪恩”(Wonder Dean)——肯塔基德比 2026年肯塔基德比三重彩派奖金额 肯塔基德比参赛马匹的年龄 何塞·奥尔蒂斯(Jose Ortiz)身在何处 Kentucky Derby முடிவுகள் Cherie Devaux Golden Tempo Golden Tempo குதிரை Kentucky Derby-யில் வென்றவர் யார்? Kentucky Derby 2026 முடிவுகள் Kentucky Derby வெற்றியாளர் Jose Ortiz (குதிரை ஓட்டுநர்) Jose Ortiz Golden Tempo-வின் வெற்றி வாய்ப்புகள் (Odds) Kentucky Derby வெற்றியாளர்கள் Derby முடிவுகள் Golden Tempo-வின் உரிமையாளர் யார்? Derby வெற்றியாளர் Preakness 2026 Golden Tempo உரிமையாளர் Derby முடிவுகள் 2026 Golden Tempo குதிரையின் வெற்றி வாய்ப்புகள் Cherie Devaux-வின் கணவர் Kentucky Derby-யில் எந்தக் குதிரை வென்றது? Kentucky Derby-யில் வென்றவர் யார்? Daisy Phipps Pulito Golden Tempo-வின் குதிரை ஓட்டுநர் Golden Tempo குதிரையின் உரிமையாளர் யார்? Phipps Stable Golden Tempo-வின் வெற்றி வாய்ப்புகள் என்னவாக இருந்தன? Derby-யில் வென்றவர் யார்? Kentucky Derby நேரலை இன்று Kentucky Derby-யில் வென்றவர் யார்? Kentucky Derby மகிழ்ச்சித் தருணங்கள் Kentucky Kentucky Derby பந்தயத் தூரம் எவ்வளவு? Golden Tempo Kentucky Derby Derby வெற்றியாளர்கள் Kentucky Derby நிறைவு Kentucky Derby 2026 நேரலை Kentucky Derby-யில் எத்தனை பந்தயங்கள் நடைபெறும்? Kentucky Derby மறுஒளிபரப்பு Danon Bourbon குதிரை இன்றைய குதிரைப் பந்தயம் Danon Bourbon 2026 Derby-யில் வென்றவர் யார்? கடைசியாக Triple Crown வென்றவர் Kentucky Derby 2026 இன்றைய முடிவுகள் Golden Tempo-வின் பயிற்சியாளர் Kentucky Derby தொடங்கும் நேரம் Kentucky Derby 2026 வெற்றியாளர்கள் Golden Tempo குதிரையின் வம்சாவளி விவரங்கள் Irad Ortiz Jr. Golden Tempo-வின் உரிமையாளர் Kentucky Derby 2026 நிறைவு வரிசை Kentucky Derby இறுதி முடிவுகள் 2025 Kentucky Derby-யில் வென்றவர் யார்? Cherie Devaux Vincent Viola Kentucky Derby வெற்றியாளர் Kentucky Derby-யில் எந்தக் குதிரை வென்றது? Preakness 2026 எப்போது நடைபெறும்? Preakness Kentucky Derby-யின் பெண் பயிற்சியாளர் Golden Tempo குதிரையின் உரிமையாளர் Cherie Devaux (பயிற்சியாளர்) Derby-யில் வென்றவர் யார்? இன்றைய Derby முடிவுகள் Derby நேரலை Kentucky Derby முடிவுகள் Cherie Devaux-வின் வயது இன்றைய குதிரைப் பந்தயம் Kentucky Derby 2026 மறுஒளிபரப்பு Irad Ortiz Derby நிறைவு Kentucky Derby முழுமையான முடிவுகள் Kentucky Derby தரவரிசைகள் 152-வது Kentucky Derby Kentucky Derby 2026 நிறைவு வரிசை Derby நிறைவு வரிசை Kentucky Derby-யில் பயிற்சியாளருக்கு எவ்வளவு பரிசுத் தொகை கிடைக்கும்? டெர்பி Preakness Stakes 2026 Cherie Devaux-வின் குழந்தைகள் Kentucky Derby வெற்றியாளர் Daisy Phipps Kentucky Derby நேரலை Kentucky Derby போட்டி எவ்வளவு நேரம் நீடிக்கும்? Kentucky Derby-யின் முதல் பெண் பயிற்சியாளர் 2026 டெர்பி முடிவுகள் Golden Tempo குதிரையின் உரிமையாளர் யார்? இன்று டெர்பி போட்டியில் வென்றவர் யார்? Kentucky Derby 2026 நேரலை ஒளிபரப்பு Kentucky Derby 2026 முழு முடிவுகள் Kentucky Derby 2026 காணொளி Golden Tempo குதிரையின் உரிமையாளர்கள் Albus (Kentucky Derby) Kentucky Derby 2025-இல் வென்றவர் யார்? Golden Tempo குதிரையின் வெற்றி வாய்ப்புகள் (Odds) Kentucky Derby வெற்றியாளருக்கு என்ன பரிசு கிடைக்கும்? Kentucky Derby-யில் குதிரைகள் எவ்வளவு வேகத்தில் ஓடும்? Kentucky Derby ஜாக்கிகள் (Jockeys) Ocelli (Kentucky Derby) ஜாக்கி Jose Ortiz Kentucky Derby எங்கு நடைபெறுகிறது? குதிரைப் பந்தயம் Golden Tempo-வின் இன்றைய வெற்றி வாய்ப்புகள் Kentucky Derby-யில் பங்கேற்ற பெண் ஜாக்கி