Member-only story

A Quick Guide to CSS

Ariel Jakubowski
6 min readJul 11, 2019

--

Cascading Style Sheets (CSS) is what controls the aesthetics of a webpage. It determines the colors, sizes, and fonts of elements on a webpage. CSS is applied to HTML elements.

Writing CSS

When writing CSS, there are two parts to a CSS declaration; a property and a value. The property is what aspect of an HTML element you are changing. The value is what you want the property to be. For example, if you want to make your text blue, you will set the color property to blue.

A value can be either a word or a number. Some number values require units. There are two types of CSS units; absolute units and relative units. Absolute units are tied to physical units (inches, millimeters). Relative units can be relative to either the size of a user’s viewport or to the size of another element on the webpage. Some of the most common units are pt (point), pixels (px), and % (percent). Point refers to font size. Pixels refers to how many pixels an element will span. Percent indicates what percentage of the screen an element will fill.

Applying CSS

There are three ways CSS can be written. It can be written with inline formatting, meaning the CSS is written inside of an HTML tag, using the “style” attribute. This CSS would apply only to this single HTML element.

<p style=”color …

--

--

Ariel Jakubowski
Ariel Jakubowski

Written by Ariel Jakubowski

Full Stack Software Engineer/ Web Developer and former Mechanical Engineer https://www.linkedin.com/in/ariel-jakubowski/

No responses yet