Lecture Summaries class 5

Prepared by: Anthony Larrain

These notes serve as an outline to the lecture, they are not intended to be complete. Attend class to get more details.


Homework 1 Comments

Comments


A Warning

Warning


Labs


Some More HTML tags


Intro to CSS

There are many other benefits, we will address these throughout the quarter.

Consider deflistcolor.html, to change the color of the term we are defining we had to nest a font tag within a dt tag. Furthermore, to get the term bold we also had to nest a strong tag. Then we had to do this for each of the terms.

We see even in this simple example we have quite a few tags. With CSS we can define a rule for the dt tag, such that whenever we use the dt tag the text will appear blue and bold. We say we are giving style to the tag


Defining Rules(Styles)

Each rule is made up of a selector ,an HTML element such as dt, body, p, h1, li etc.., and declarations, that determine how the selected element will be displayed.

Example, to make the dt tag appear blue we would write:

dt {color:blue}

dt is the selector

color:blue is the declaration

To make the font bold we would write:

dt {font-weight:bold}

Since both descriptions pertain to the same selector(tag), we can combine them:

dt{color:blue;font-weight:bold}

We use a semicolon ';' to separate descriptions

To get the style to work we place the code in between style tags and nest this within the head tag. See source code for: defliststyle.html

Note I am adding other styles.