<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u" -->

---
title: A Dynamically-Sized Sticky Sidebar with HTML and CSS
description: Sticky positioning can get a bit tricky, particularly when it comes to height and the dangerous situation of hiding content in a position that can’t be...
canonical: https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A Dynamically-Sized Sticky Sidebar with HTML and CSS | daily.dev
og:description: Sticky positioning can get a bit tricky, particularly when it comes to height and the dangerous situation of hiding content in a position that can’t be...
og:url: https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u
og:image: https://api.daily.dev/og/posts/IY0fclp5u.png
og:image:alt: A Dynamically-Sized Sticky Sidebar with HTML and CSS
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A Dynamically-Sized Sticky Sidebar with HTML and CSS

**[CSS-Tricks](https://daily.dev/sources/css_tricks)** · 3 min read · 13 upvotes · 1 comments

## Summary

Sticky positioning can get a bit tricky, particularly when it comes to height and the dangerous situation of hiding content in a position that can’t be scrolled to. I recently worked on a desktop layout that we’re all familiar with: a main content area with a sidebar next to it. This particular sidebar contains action items and filters that are pertinent to the main content.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://css-tricks.com/a-dynamically-sized-sticky-sidebar-with-html-and-css/>

## Community discussion

Top comments from developers on daily.dev.

**@amol\_8458** · 0 upvotes

> Very Informative KUDOS

---

Tags: [#css](https://daily.dev/tags/css), [#html](https://daily.dev/tags/html)

[View this post on daily.dev](https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A Dynamically-Sized Sticky Sidebar with HTML and CSS","url":"https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u"},"datePublished":"2020-11-20T16:53:35.221Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Sticky positioning can get a bit tricky, particularly when it comes to height and the dangerous situation of hiding content in a position that can’t be...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b8204bb09b62f8aff622b2aea6e54eca","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b8204bb09b62f8aff622b2aea6e54eca","isAccessibleForFree":true,"articleSection":"CSS-Tricks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"CSS-Tricks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/css_tricks","url":"https://daily.dev/sources/css_tricks"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"css,html","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"CSS-Tricks","item":"https://daily.dev/sources/css_tricks"},{"@type":"ListItem","position":3,"name":"A Dynamically-Sized Sticky Sidebar with HTML and CSS"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/a-dynamically-sized-sticky-sidebar-with-html-and-css-iy0fclp5u","comment":[{"@type":"Comment","text":"Very Informative KUDOS","datePublished":"2020-11-20T18:55:56.736Z","url":"https://daily.dev/posts/IY0fclp5u#c-Dux7VF8eN","author":{"@type":"Person","name":"amol_2488","url":"https://daily.dev/amol_8458","image":"https://avatars2.githubusercontent.com/u/56102962?v=4"}}]}
```

