Claire Dushane | Summary 3 - How CSS Works

back to home page

Summary 3

CSS Rule Naming Conventions

CSS rule is compiled of two parts; the declaration and the selector. Throughout these parties comes basic rule structures that are expanded into three ways. The first is Multiple declarations can be contained within a rule. The second is multiple selctors can be grouped. and Finally multiple rules can be applied to the same selector.


When to use and ID and when to use a Class

Knowing what each is used for is typically a good place to start. Both an ID and class are both HTML attributes. The overall purpose of ID is to identify an elemnt within a page. You may use nav to enclose the menu's elemnts. The purpose of a class is to be able to idenfity a number of elemnts that can and will share a basic amount of different characteristics. Both of these can also be assigned the same set of CSS rules.


Inheritance

Inheritance is when CSS involves passing something from a ancestors to descendants. This will eb the values of the CSS properties. It is more obvious than specific to a particular family font. This is how a majority of CSS properties are inherited; text, folor, font and size.