completefrontend
BLOGS BY CATEGORY

HTML and CSS

How web pages are built and styled: layout with flexbox and grid, the box model, units, and responsive design.

Title card for Tailwind CSS vs CSS, comparing a .save-button rule with padding 0.5rem 1rem to the Tailwind classes px-4 py-2, next to the blue Save button both produce

HTML and CSS

Should you use Tailwind CSS or plain CSS?

Tailwind CSS styles elements with small utility classes in your HTML, while plain CSS uses your own rules in a stylesheet. Here's the same button written both…

5 min read

Title card for what is responsive web design, with the same cards laid out in one column on a phone, two on a tablet, and three on a laptop

HTML and CSS

What is responsive web design?

Responsive web design means one page that fits any screen, from a phone to a wide monitor. Here's what the viewport meta tag does, how fluid layouts and media…

5 min read

Title card for px vs em vs rem in CSS, with three blocks: px is a fixed size, em follows the local font size, and rem follows the root font size

HTML and CSS

px vs em vs rem in CSS

px is fixed, em follows the font size of the element or its parent, and rem follows the root font size. Here's how each one works out in pixels, why em…

4 min read

Title card for what is CSS specificity, with selectors ranked from weakest to strongest: p at 0-0-1, .note at 0-1-0, #intro at 1-0-0, an inline style, then !important

HTML and CSS

What is CSS specificity?

When your CSS doesn't apply, another rule is usually winning. Here's how the browser scores selectors, why one ID beats any number of classes, where inline…

5 min read

Three blocks joined by plus signs: HTML for structure with a button tag, CSS for style with a button rule, and JavaScript for behavior with a line that adds one

HTML and CSS

What do HTML, CSS, and JavaScript each do?

HTML gives a web page its structure, CSS gives it its style, and JavaScript makes it respond. Here's what each one does, one small page built in all three…

4 min read

A dashed box with guide lines through its middle and a card reading place-items: center sitting exactly in the center

HTML and CSS

How to center a div with CSS

Centering a div is easy once you know which box to style. Here are the five reliable ways, from grid and flexbox to margin auto, each with a short code sample…

5 min read

On the left, a flex row of menu links with Sign in pushed to the far right. On the right, a grid of eight equal cells in four columns and two rows

HTML and CSS

Flexbox vs grid in CSS

Flexbox lines things up in one direction, and grid lines them up in rows and columns at once. Here's the same layout built both ways, a table to help you…

5 min read

Four nested bands from the outside in: a dashed margin, a peach border, a light padding band, and the content in the middle

HTML and CSS

What is the CSS box model?

Every element on a page is a box with four layers: content, padding, border, and margin. Here's how those layers add up to a box's size, what box-sizing…

4 min read