HTML2
HTML2
Lecture 2
CGS 3066 Fall 2016
I In style sheets there are often elements with the same style.
I In the interest of code minimization, we can group selectors.
I Selectors are separated by commas.
I Example:
h1, h2, p {
text-align: center;
color: red;
}
Adding CSS to your HTML document
I myStyle.css
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
I In the head tag of the HTML document
<head>
<link rel=“stylesheet” type=“text/css” href=“mystyle.css”>
</head>
Why “Cascading”?