Intro To HTML CSS
Intro To HTML CSS
Rachel Starry
Ursinus College, Tech Play Day
May 31, 2018
What is HTML?
<!DOCTYPE html>
<html>
<head>
<title>My first HTML page</title>
</head>
<body>
<p>This is where we put content.</p>
</body>
</html>
More HTML Markup Tags
* TASK: Add a title to your hyperlink and one or more size attributes
to your image. How does your image change when you define one
or more size attributes? What might be a drawback of using these?
* Bonus: Images can be wrapped in anchor tags, just like text! Try
adding an ‘alt’ attribute to your image and wrapping it in <a>…</a>.
What happens when you hover over the image now?
Tables in HTML
* TASK: Try to replicate the table below. Hint: play around with the
attribute values to see how they change the appearance and
layout of the table! Make sure
to save your .html file when
you’ve finished.
* Inline:
(property) (value)
* Demo: https://www.w3schools.com/css/css_intro.asp
Example styles.css
body {
background-color: lightblue;
}
h1 {
color: white;
font-size: 20px;
}
p{
color: black;
}
Types of CSS Selectors
<p>This is a paragraph.</p>
<h2>Paris</h2>
<p class="city">Paris is the capital of France.</p>
* 3b. The class selector can specify that only certain HTML
elements should be affected by a class style. Here only
paragraphs of class “city” will be affected.
<h2 class="city">London</h2>
<p>London is the capital of England.</p>
HTML
<h2>Paris</h2>
<p class="city">Paris is the capital of France.</p>
* HTML: https://www.w3schools.com/Html/
* CSS: https://www.w3schools.com/css/default.asp