CSS Use Cases Preview
CSS Use Cases Preview
By Use Cases
ebook by Joe Harrison
Introduction
cleanest syntax. I also hope the ebook can provide you with a host
when you see each property in the code and the CSS world will
become clearer.
Popular Properties
background
background
Popular Properties
Arguably the most used property in your CSS toolkit and a great
place for us to start. It has to be combined with certain properties to
see its full effect, for example - width and height. As well as making
your components look awesome, backgrounds can also be used to
debug complex CSS layout and overflow issues.
Syntax
As you’ll see here, I generally only use the background shorthand for
images and colors. Anything else I usually add separate longhand
properties, for me it just reads cleaner this way. We will learn more
about longhand and shorthand syntax throught this ebook.
Special Power
Tips
Popular Properties
border
border
Popular Properties
Aside from the obvious use case of putting a line around a box,
borders can be used to achieve many cool effects in CSS. In a
similar way to backgrounds, borders can also be useful when
debugging complex CSS issues.
Syntax
Again like background, border comes with it’s own shorthand syntax
as well as a few longhand properties. It’s just personal preference,
but you’ll see from my code here that I often favour the longhand.
Special Power
Being able to set different border for each side of the element,
allows us to create abstract shapes like triangles and circular
spinners. You’ll find a codepen link containing a plethora of CSS
border spinners in the references section of this ebook.
Tips