Home

Absolute vs. Relative Positioning

The golden rule of absolute positioning.

If you've ever tried to lay out an HTML page with a second column or sidebar, I'd bet you ran into an issue with the position property at one point or another.

I was struggling with this until I came across advice I will now never forget. This is the golden rule of absolute positioning:

An absolutely positioned element is positioned relative to the closest ancestor that is positioned relatively.

In other words, if you want to absolutely position an element in relation to its parent, the parent MUST be relatively positioned.

As usual, Chris Coyier has some good examples.

Let's Connect

Keep Reading

3 CSS Button Generators To Help You Style Buttons

A few references for styling buttons with CSS. I'll also point you to a couple CSS frameworks.

Feb 06, 2013

Are You Overthinking CSS?

CSS is inherently simple. Maybe you're overthinking it. Maybe you don't need some crazy system guiding your CSS. Maybe you just need a few simple rules.

Dec 16, 2018

A Brief Introduction to Inlining Critical CSS

Although more applicable to traditionally-built sites, inlining critical CSS can be a quick and easy performance boost for your site, especially as it grows.

Jun 25, 2022