Introductions/Icebreaker
Review HTML and Validation
CSS Basics: Syntax, Selectors, and Some Styles
By the end of this section, you should be able to:
<ta>Hello world!</ta>
Fix the validation errors in dogs.html
and
make it match the CSE 154 code quality guide.
<!DOCTYPE html>
<html>
<body>
<title>Dogs are the Best!</title>
<h1>Dogs are the best!!!</h1>
<h2>Why dogs are <em>the best</h2></em>
<p>
<ul>
<li>Doggos are happy & cuddly</li>
<li>Doggos make people happy too</li>
<li>They're obviously the best</li>
</ul>
</p>
<h2>Did you know?</h2>
Doggies are the best
<h2>Dog pictures:</h2>
<img src="images/puppy-mowgli.jpg"></img>
<img src="images/moar-puppy-mowgli.jpg"></img>
</body>
</html>
</!DOCTYPE>
<!DOCTYPE html>
<html>
<head>
<title>Dogs are the Best!</title>
</head>
<body>
<h1>Dogs are the best!!!</h1>
<h2>Why dogs are <em>the best</em></h2>
<ul>
<li>Doggos are happy & cuddly</li>
<li>Doggos make people happy too</li>
<li>They're obviously the best</li>
</ul>
<h2>Did you know?</h2>
<p>Doggies are the best</p>
<h2>Dog pictures:</h2>
<p>
<img src="images/puppy-mowgli.jpg" alt="cute pupper"/>
<img src="images/moar-puppy-mowgli.jpg" alt="moar cute pupper"/>
</p>
</body>
</html>
Directions: Use the given HTML code and CSS selector tool on the slide below to improve your skills in CSS selectors!
Write a CSS selector here for:
h2
elementsintro
h2
elements inside intro
h2
elements inside content
and footer
p
elements inside content
p
elements directly inside content
bordered
h2
elements with class bordered
h2
elementsh2intro
#introh2
elements inside intro
#intro
h2h2
elements inside content, footer
#content h2, #footer h2p
elements inside content
#content pp
elements directly inside content
#content > pbordered
.borderedh2
elements with class bordered
h2.borderedGiven the following HTML, what HTML and CSS would be necessary to produce the expected output below? (You can download the HTML here).
<h2>CSS: Corgis, Short & Sweet</h2>
#444
.
Note: you may add
<span>
tags as appropriate to get the desired
output.
CSS: Corgis,
Short &
Sweet
h2 {
color: #444;
}
#css-abbr {
color: green;
text-decoration: underline;
font-size: 40pt;
}
#short, #sweet {
font-family: cursive;
}
#short {
font-size: 14pt;
text-transform: lowercase;
}
#sweet {
color: purple;
font-style: italic;
}