Make the #title blue.
Acceptance criteria
- 1.#title has color: rgb(0, 0, 255)
Pick a result and write the CSS that makes it. Every exercise here runs without an account.
103 shown
#title { color: blue; }p { color: green; }#text { color: navy; }Write a red rule and a blue rule for #text, then comment out the red one.
More on CSS Comments/* #text { color: red; } */
#text { color: blue; }#parent { color: red; }Write a .card rule that makes the text blue and an #one rule that makes it red. The id should win.
More on CSS Specificity.card { color: blue; }
#one { color: red; }#box { width: 150px; }#box { box-sizing: border-box; }:root { --brand: red; }
#box { color: var(--brand); }#box { width: calc(100px + 50px); }p { color: red; }Use the .feature class to give all three cards a teal background, white text, and a 12px border radius.
More on CSS Class Selector.features {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
font-family: Arial, sans-serif;
}
.feature {
padding: 24px 12px;
text-align: center;
background-color: #007a96;
color: #ffffff;
border-radius: 12px;
}#one { color: red; }* { box-sizing: border-box; }p, span { color: red; }.card p { color: red; }Style any element that has a data-role attribute.
More on CSS Attribute Selectors[data-role] { color: red; }.card:first-child { color: red; }Add a ::before marker to .text and colour the paragraph red.
More on CSS Pseudo Elements.text { color: red; }
.text::before { content: "-> "; }#box { color: red; }#box { color: #ff5733; }#box { color: rgb(255, 87, 51); }#box { color: oklch(0.7 0.15 200); }#box { background-color: #f0f0f0; }#box { background-image: linear-gradient(red, blue); }Layer a red-to-blue gradient over a green-to-yellow one.
More on Layered Backgrounds#box { background-image: linear-gradient(red, blue), linear-gradient(green, yellow); }#text { color: #333333; }#text { text-align: center; }#text { text-decoration: underline; }#text { font-family: Arial, sans-serif; }#text { font-size: 24px; }#text { font-weight: bold; }#text { white-space: nowrap; }#box { margin: 20px; }#box { padding: 16px; }#box { border: 2px solid red; }#box { outline: 3px solid #0f172a; }#box { width: 200px; }#box { float: left; }#text { display: inline; }#box { position: relative; top: 10px; }#wrap { position: relative; }#box { float: left; }#box { overflow: hidden; }#box { position: relative; z-index: 10; }#box { min-width: min-content; }#box { aspect-ratio: 16 / 9; }#wrap { column-count: 3; }Make .navbar a flex container with its items spread apart using justify-content: space-between.
More on Flex Container.navbar {
display: flex;
justify-content: space-between;
padding: 16px 24px;
background: white;
border-radius: 10px;
}#row { display: flex; flex-direction: column; }#row { display: flex; justify-content: center; }#row { display: flex; align-items: center; }#row { display: flex; flex-wrap: wrap; }#row { display: flex; }
.item { flex-grow: 1; }Make .gallery a grid container with exactly three equal columns, using grid-template-columns: repeat(3, 1fr).
More on CSS Grid Container.gallery {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
}
.tile { height: 100px; background: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; }#grid { display: grid; grid-template-columns: 100px 200px; }#grid { display: grid; grid-template-rows: 60px 80px 100px; }#grid { display: grid; gap: 16px; }#grid { display: grid; grid-template-columns: repeat(3, 100px); gap: 12px; }#grid { display: grid; grid-template-columns: repeat(4, 60px); }
.cell { grid-column: span 2; }#grid { display: grid; grid-template-areas: "a b c"; }#grid { display: grid; grid-template-columns: 100px 100px; }
.cell { display: grid; }#list { list-style-type: square; }#table { border-collapse: collapse; }#input { padding: 8px; border: 1px solid #cccccc; }#input { border-radius: 6px; }Give #box a red shadow offset 2px right, 4px down, blurred 6px.
More on CSS Shadows#box { box-shadow: 2px 4px 6px red; }#box { background-image: linear-gradient(45deg, red, blue); }#box { filter: blur(4px); }#box { opacity: 0.5; }#box { clip-path: circle(50%); }#box { mix-blend-mode: multiply; }#wrap { scroll-behavior: smooth; }#box { rotate: 45deg; }#box { transform: scale(2); }#wrap { perspective: 800px; }#box { transition-property: opacity; }Let #box transition discrete properties such as display.
More on Entry & Exit Transitions#box { transition-behavior: allow-discrete; }@keyframes spin { from { rotate: 0deg; } to { rotate: 360deg; } }
#box { animation-name: spin; }Tie the animation on #box to the scroll progress.
More on Scroll Animations@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#box { animation-name: fade; animation-timeline: scroll(); }#box { view-transition-name: card; }#box { offset-path: path('M 0 0 L 100 100'); }@media (max-width: 600px) {
#text { font-size: 14px; }
}.cell { max-width: 100%; }#grid { display: grid; grid-template-columns: 100px; }
@media (min-width: 700px) {
#grid { grid-template-columns: 100px 100px 100px; }
}#wrap { container-type: inline-size; }When no reduced motion is requested, make #text teal.
More on Preference Media Queries@media (prefers-reduced-motion: no-preference) {
#text { color: teal; }
}@supports (display: grid) {
#grid { display: grid; }
}Give #link a 2px solid navy outline instead of removing it.
More on Accessible CSS#link { outline: 2px solid navy; }#wrap { color-scheme: dark; }#check { accent-color: red; }#btn { cursor: pointer; }#wrap { break-inside: avoid; }#wrap { contain: layout; }#wrap { --space: 16px; padding: var(--space); }#wrap { outline: 2px solid red; }At 500px wide, make #box red inside a max-width media query.
More on CSS At-rules@media (max-width: 600px) {
#box { color: rgb(255, 0, 0); }
}#box { width: calc(60px + 40px); }#list { display: flex; }The first in every lesson is free. The rest come with the practice plan, and your first month costs nothing.
See the practice plan