HTML and Javascript, Day 3: CSS
2025-09-15
Day 1:
<h1>, <p>, <em>, <strong>, <a>, <img>, <ul>, <li>href and altDay 2:
<head>, <nav>, <main>, <section>, <footer>We built a simple page with our name, a paragraph, a link, an image, and a list, and then structured it.
firstname_lastname.html<head>, paste:<style> section.<style> section..css file<style> code in the <head>, though.css file.
styles.css..css file.css file..css filefirstname_lastname.html<head>.css fileF12Ctrl/Command + Shift + i9_stinky_style.css<h1>) as you can. How do we edit their style?px, rem, and ch. Ponder what they mean, then double check your guess using Google.h1 = the Selector
{ … } after a selector: { font-size:...}color, margin)black, 1rem)p { … }
.highlight { … }
#cheeses { … }
a:hover { … }
<p class="highlight">This text is highlighted.</p>
<p class="highlight">This one is too!</p>
<p>This one is not.</p><p> marked as class="highlight" will be treated specially.:var(--???)css code, we find some properties marked as follows:var(--???):root{}:root {
/* Palette (named colors for now) */
--brand-brown: brown;
--brand-gold: goldenrod;
--paper: oldlace; /* warm page background */
--ink: black; /* default text color */
/* Layout & rhythm */
--page-width: 60ch; /* ~60 characters per line for readability */
--space-1: 0.5rem;
--space-2: 1rem;
--space-3: 1.5rem;
--space-4: 2rem;
/* Rounding */
--radius: 12px;
}var(--???)css head:root so they apply everywhere:root { --ink: black; }
body { color: var(--ink); }
h1 { color: var(--ink); }
footer { color: var(--ink); }.css file for your websiteStep 1: Create a new style sheet, called lastname_style.css
Step 2: Link your stylesheet in the <head>
Step 3: Add Rules like These, Filling in Values:
/* Headings */
h1 {
color: xxxx;
text-align: xxxx;
}
h2 {
color: xxxx;
margin-top: xxxx;
}
/* Paragraphs */
p {
line-height: xxxx;
font-size: xxxx;
}
/* Lists */
ul {
list-style-type: xxxx;
padding-left: xxxx;
}
/* Footer */
footer {
text-align: xxxx;
margin-top: xxxx;
font-size: xxxx;
color: xxxx;
}Step 4: Save, Stage, Commit, Push!