Nov 07, 2013 · The aim of this tutorial is to introduce you to several techniques that can be used to create this dimmed overlay with CSS, and determine the pros and cons of each technique as we go over them. Technique #1: Absolutely positioned element. The first way that an overlay can be created is by absolutely positioning an HTML element on the page. The first line says that this is a style sheet and that it is written in CSS (“text/css”). The second line says that we add style to the “body” element. The third line sets the color of the text to purple and the next line sets the background to a sort of greenish yellow.