All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

CSS Implementation of Optical Illusions: Visual Perception Effects Created with Web Technologies

By

ulrischa

4mo ago· 16 min readen

Summary

This article presents a collection of 50+ optical illusions created using CSS and HTML, demonstrating how visual perception tricks can be implemented with web technologies. The author shows specific examples like the Poggendorff illusion, explaining how CSS pseudo-elements (::before and ::after) can be used to create these effects. The content serves as both a technical tutorial for web developers and an exploration of visual perception through code.

Key quotes

· 4 pulled
You can find a collection with all the optical illusions in this article (and more!) on CodePen.
The Poggendorff illusion is an optical illusion in which a diagonal line interrupted by a vertical bar appears misaligned, even when both segments are actually continuous.
A simple version of this effect can be seen in the following demo. I used the ::before and ::after pseudo-elements to create the diagonal line and the vertical bar, respectively.
A collection of 50+ optical illusions coded with CSS and HTML.
Snippet from the RSS feed
A collection of 50+ optical illusions coded with CSS and HTML. :: Blog post at Alvaro Montoro's Personal Website.

You might also wanna read