projects.html
wk05.md
oim3690
username.github.io
PROPOSAL.md
"OIM3690: CSS question"
Please put away all electronics.
Read each question carefully before answering.
Good luck!
<header>
<nav>
<main>
<footer>
alt
Last session we covered:
color
font-family
padding
Today: typography, Google Fonts, the box model, and display types
font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; /* or 400, 700, etc. */ font-style: italic; text-align: center; /* left, right, justify */ text-decoration: underline; line-height: 1.5;
<!-- In <head> --> <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
body { font-family: 'Roboto', sans-serif; }
Browse fonts at fonts.google.com
.box { /* Content size */ width: 200px; height: 100px; /* Padding (inside) */ padding: 20px; /* Border */ border: 2px solid black; /* Margin (outside) */ margin: 10px; }
/* All four sides */ padding: 10px; /* Vertical | Horizontal */ padding: 10px 20px; /* Top | Right | Bottom | Left (clockwise) */ padding: 10px 20px 10px 20px; /* Individual sides */ padding-top: 10px; margin-left: 20px;
/* Default: width doesn't include padding/border */ box-sizing: content-box; /* Better: width includes padding/border */ box-sizing: border-box; /* Apply to all elements (recommended) */ * { box-sizing: border-box; }
/* Block: takes full width, starts on new line */ display: block; /* div, p, h1 default */ /* Inline: flows with text, no width/height */ display: inline; /* span, a, strong default */ /* Inline-block: flows inline but accepts width/height */ display: inline-block; /* None: hides element completely */ display: none;
<div>
<span>
<div> - Block container (groups elements)
<div class="card"> <h2>Title</h2> <p>Content here...</p> </div>
<span> - Inline container (style part of text)
<p>The price is <span class="price">$99</span> today!</p>
Step 1: Create projects.html with this starter:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My Projects</title> <link rel="stylesheet" href="css/projects.css"> </head> <body> <h1>My Projects</h1> <p>A collection of projects from OIM3690.</p> <div> <h2>Project 1</h2> <p>Coming soon...</p> </div> <div> <h2>Project 2</h2> <p>Coming soon...</p> </div> </body> </html>
Step 2: Create css/projects.css and try these:
css/projects.css
margin
border
solid
dashed
dotted
Step 3: Use Copilot to suggest improvements. Review each suggestion:
Next session: CSS selectors (class, ID, and more) + a fun game!