Let's write and publish a webpage from scratch!
Non-semantic tags were deprecated! 🤢
<b> <i> <font>
New semantic tags were added! 😍
<header> <nav> <article>
<section> <main> <footer>
Who needs YouTube when you have...
<audio src="o_tannenbaum.ogg" controls="true" preload="true">
</audio>
<video src="bunny_trailer.webm" controls width="390">
</video>
First, the domain is resolved over DNS:
Ways to check DNS status:
ping cs.berkeley.edu
dig cs.berkeley.edu
The browser requests the webpage over HTTP:
The server responds over HTTP with the HTML:
curl
command
Let's explore it...
Blog post: How Khan Academy Successfully Handled 2.5x Traffic in a Week
More reading: MDN: linear-gradient
@font-face {
font-family: 'LeagueGothicRegular';
src: url('fonts/leaguegothic/leaguegothic-webfont.eot');
}
.special-header {
font-family: 'LeagueGothicRegular', sans-serif;
}
Finding fonts:
Use CSS3 @keyframes to define a custom CSS3 animation. Example:
@keyframes pulse {
from {
opacity: 0.0;
font-size: 100%;
}
to {
opacity: 1.0;
font-size: 200%;
}
}
caniuse.com: animations
Apply the CSS animation you defined to a specific HTML element.
<div>Pulse!</div>
div {
animation-name: pulse;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: ease-in;
animation-direction: alternate;
}
@keyframes rainbow {
0% {
background-color: red;
width:500px;
}
25% {
background-color: yellow;
width: 200px;
}
50% {
background-color: blue;
width: 300px
}
100% {
background-color: green;
width: 200px;
}
}
div {
animation-name: rainbow;
animation-duration: 6s;
animation-iteration-count: infinite;
animation-timing-function: ease-in;
animation-direction: alternate;
}
#box.left {
margin-left: 0;
}
#box.right {
margin-left: 1000px;
}
document.getElementById('box').className = 'left';
document.getElementById('box').className = 'right';
#box {
transition: margin-left 1s ease-in-out;
}
document.getElementById('box').className = 'left';
document.getElementById('box').className = 'right';
You can transform this div by hovering over it!
#transform-example {
transform: rotateZ(5deg);
transition: transform 2s ease-in-out;
}
#transform-example:hover {
transform: rotateZ(-5deg);
}
Other transform values:
See the Pen Submarine with CSS by Alberto Jerez (@ajerez) on CodePen.
.staff-gallery {
display: flex;
flex-wrap: wrap;
}
.staff-gallery div {
height: 150px;
flex-grow: 1;
}
Pamela Fox (she/her)
Michael Ball (he/him)
Rajavi Mishra (she/her)
Samson Petrosyan (he/him)
Gurpreet Kaur Khalsa
Jimmy Xu (he/him)
Abhinav Dhulipala (he/him)
Amritansh Saraf
Angela Jiang (she/her)
Michael (Mike) Chou (he/him)
.grid-gallery {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(2, 5vw);
grid-gap: 15px;
}
.grid-gallery img {
width: 100%;
height: 100%;
object-fit: cover;
}
.grid-gallery .img1 {
grid-column: 1 / span 2;
grid-row: 1 / span 2;
}
.grid-gallery .img2 {
grid-column: 3 / span 2;
grid-row: 1 / span 2;
}
Create an image gallery with CSS grid
CSS Tricks: A complete guide to Grid