How To Use This
Pick one tag or property, test it in your project, then save.
Use the examples exactly first, then modify one value at a time.
Student Reference
Use this page while coding in the IDE. Every concept includes plain-language definitions and direct examples you can copy into your project.
Pick one tag or property, test it in your project, then save.
Use the examples exactly first, then modify one value at a time.
1) Structure with HTML.
2) Style with CSS.
3) Refresh your preview and compare changes.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Title</title>
</head>
<body>
<main>
<h1>Hello world</h1>
<p>Start building your page here.</p>
</main>
</body>
</html>
Think of CSS as the design layer that controls how HTML looks.
| Property | Definition | Example |
|---|---|---|
| color | Sets text color. | color: #1e1f22; |
| background-color | Sets element background color. | background-color: #f4f7ff; |
| font-size | Controls text size. | font-size: 18px; |
| font-family | Changes the typeface. | font-family: Verdana, sans-serif; |
| margin | Adds outer spacing around an element. | margin: 16px; |
| padding | Adds inner spacing inside an element. | padding: 12px; |
| border | Draws an outline around an element. | border: 1px solid #223150; |
| display | Defines layout behavior. | display: flex; |
| justify-content | Aligns flex items horizontally. | justify-content: space-between; |
| align-items | Aligns flex items vertically. | align-items: center; |
| grid-template-columns | Sets the number/size of grid columns. | grid-template-columns: 1fr 1fr; |
| border-radius | Rounds element corners. | border-radius: 12px; |
<div class="profile-card">
<h2>Marco Morais</h2>
<p>Web Design Student</p>
<button>View Project</button>
</div>
.profile-card {
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 12px;
padding: 16px;
width: 260px;
}
.profile-card h2 {
margin-top: 0;
}
Web Design Student
<nav class="sample-nav">
<a href="#">Home</a>
<a href="#">Projects</a>
<a href="#">Contact</a>
</nav>
.sample-nav {
display: flex;
gap: 10px;
}
.sample-nav a {
text-decoration: none;
background: #1b2a44;
color: #e8f1ff;
padding: 8px 12px;
border-radius: 999px;
}
/* Element selector */
p {
color: #1e1f22;
}
/* Class selector */
.card {
padding: 16px;
}
/* ID selector */
#hero {
margin-top: 20px;
}
/* Descendant selector */
.nav a {
text-decoration: none;
}
/* Pseudo-class */
button:hover {
opacity: 0.9;
}