Get the latest tech news

A gentle introduction to anchor positioning


Anchor positioning allows you to place an element on the page based on where another element is.

The position-area allows you to place your element on a nine-square grid where the anchor takes the center spot. The positioning you set for your menu works on desktop, where you’re got plenty of space on the right for the element to spill over, but what about on mobile where your viewport is more narrow? Thinking of anchor positioning as a grid that you place things on can be a helpful and intuitive way of writing your code.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Anchor

Anchor

Photo of Gentle Introduction

Gentle Introduction

Related news:

News photo

A Gentle Introduction to Graph Neural Networks (2021)

News photo

Ship's Crew Suspected of Deliberately Dragging Anchor for 100 Miles To Cut Baltic Cables

News photo

Investigators say a Chinese ship’s crew deliberately dragged its anchor to cut undersea data cables