Home › Web › HTML & CSS
Web

HTML & CSS

HTML is the structure of a web page; CSS is how it looks. Together they turn plain content into something laid out and styled.

Elements

HTML is a tree of elements written as tags. A heading, a paragraph, a link, an image, each is an element, and they nest inside one another.

<h1>Title</h1>
<p>A paragraph with a <a href="/about">link</a>.</p>
<img src="photo.jpg" alt="A photo">

CSS basics

CSS rules pick elements with a selector and set properties on them. You can select by tag, class, or id.

p { color: #333; line-height: 1.6; }
.button { background: #2864d7; color: white; padding: 8px 14px; }

Layout

Modern layouts use flexbox for rows and columns and grid for two-dimensional layouts. Media queries adjust the design for small screens.

Keep reading: APIs  ·  Databases  ·  Web Security