Class paradigm:
Encapsulation - a mechanism for restricting or controlling access to an object's components (public / private / privileged)
Inheritance - a mechanism of implementation reuse that typical establishes an is-a
relationship.
Three perspectives:
For CSS:
For HTML:
glue,
Use a combination of scripts and CSS to enable encapsulation and clean content.
⇓ the class ⇓ and id provide differently scoped access <div class="todo" id="todo-list"> <div class="controls"> ⇐ a class can be scoped by a parent class <input size="30" class="text"/><button class="add">Add</button><button class="clear">Clear</button> </div> ⇓⇑ class and markup allows navigation of contained markup <ol class="list"/> </div>
Markup provides functional overloading
:
Example: Delete the <button class="clear">...</button>
and what happens?
(exercise in class)