Tuesday, 20 March 2012

Summary of CSS document 1

We've been asked to summarise two documents given in class, I find this to be a fantastic opportunity to retain information.

CSS Inheritance

HTML is like a family tree, it has an overall parent - the html language, and tags that are descendents of this element. An ancestor is an element closer to this core parent (such as the body tag). A descendent is all the elements within that tag. A parent tag is directly above one tag - and a child is the element directly below. Like families, there can be many siblings that share te same parent.

CSS tells browsers how to interpret information about a HTML page - keeping style and content in separate documents.
There are 5 components - the "selector" which defines a rule for one element on a html page under the same tag - such as "p" - within the html document, any information within a

tag is effected by this rule. The declaration block contains the information about what and how the information will look. These changes in looks are defined by "property" values - the property to be effected is typed (such as color) and the value is the specific information (red).

Inheritance is when property values effects descendents of a tree. CSS allows a certain siblings to be effected and not others, by targeting these by creating a branch finder (specifiying a parent then child before the declaration block). However, only specific property's are inherited - some such as borders are not, as they would create borders within borders and make a gigantic mess - as the coder would have to specify that only the outer

tag is to be effected, by writing code to turn off the property for all the descendants underneath.

This can be used efficiently by making a general rule (property value) for a parent which would be inherited by the descendents. You can specify a specific child under that, and make an overriding rule for that child only.

---

Yes this is a very long summary, however I can't help but feel that the document I was summarizing off was already summarized... All of the information was extremely helpful. So for my own records and sanity I've written virtually everything in my own words - unfortunately messed up and confusing to some but I know what I'm getting at ;)

No comments:

Post a Comment