Saturday, March 21, 2009

Cascading Style Sheets II - Selectors

All CSS styles are made up of 3 parts: a selector, a property and a value. Selectors are the names that you give to your different styles, or the names of certain elements to style.

CSS selectors are a fundamental part of CSS. Selectors define which HTML elements you are going to be manipulating or styling with CSS code. In essence selectors are used to "select" the elements on an HTML page that are affected by rules.

What is a rule or a "Rule Set"? A rule or "rule set" is a CSS statement that tells the browser how it should render or display particular elements on a HTML page. A rule set has a particular syntax consisting of a selector followed by a declaration block. In my Basic CSS introduction, we got a glimpse of the rule set.

Bless the little children.

While reading the dBASE news group, I came across some really funny things and jokes about kids. This will surely light up your day.

A little girl was talking to her teacher about whales.
The teacher said it was physically impossible for a whale to swallow a human because even though it was a very large mammal its throat was very small.
The little girl stated that Jonah was swallowed by a whale.
Irritated, the teacher reiterated that a whale could not swallow a human; it was physically impossible.
The little girl said, 'When I get to heaven I will ask Jonah'.
The teacher asked, 'What if Jonah went to hell?'
The little girl replied, 'Then you ask him'.


A Kindergarten teacher was observing her classroom of children while they were drawing.. She would occasionally walk around to see each child's work.As she got to one little girl who was working diligently, she asked what the drawing was.
The girl replied, 'I'm drawing God.'
The teacher paused and said, 'But no one knows what God looks like.'
Without missing a beat, or looking up from her drawing, the girl replied, 'They will in a minute.'


A Sunday school teacher was discussing the Ten Commandments with her five and six year olds.
After explaining the commandment to 'honour' thy Father and thy Mother, she asked, 'Is there a commandment that teaches us how to treat our brothers and sisters?'
Without missing a beat one little boy (the oldest of a family) answered, 'Thou shall not kill.'


One day a little girl was sitting and watching her mother do the dishes at the kitchen sink. She suddenly noticed that her mother had several strands of white hair sticking out in contrast on her brunette head. She looked at her mother and inquisitively asked, 'Why are some of your hairs white, Mom?'
Her mother replied, 'Well, every time that you do something wrong and make me cry or unhappy, one of my hairs turns white.'
The little girl thought about this revelation for a while and then said, 'Momma, how come ALL of grandma's hairs are white?'


The children had all been photographed, and the teacher was trying to persuade them each to buy a copy of the group picture.
'Just think how nice it will be to look at it when you are all grown up and say, 'There's Jennifer, she's a lawyer,' or 'That's Michael, He's a doctor.'
A small voice at the back of the room rang out, 'And there's the teacher, she's dead.'


A teacher was giving a lesson on the circulation of the blood. Trying to make the matter clearer, she said, 'Now, class, if I stood on my head, the blood, as you know, would run into it, and I would turn red in the face.'
'Yes,' the class said.
'Then why is it that while I am standing upright in the ordinary position the blood doesn't run into my feet?'
A little fellow shouted, 'Cause your feet ain't empty.'


The children were lined up in the cafeteria of a Catholic elementary school for lunch. At the head of the table was a large pile of apples. The nun made a note, and posted on the apple tray:
'Take only ONE . God is watching.'
Moving further along the lunch line, at the other end of the table was a large pile of chocolate chip cookies....
A child had written a note, 'Take all you want. God is watching the apples.'

Cascading Style Sheets I - The-Basics

Cascading Style Sheets (CSS) is a simple mechanism for adding style. It is a stylesheet language used to describe the presentation (that is, the look and formatting) of a document written in a markup language. Today we are looking at the basics of CSS.

CSS is designed primarily to enable the separation of document content (written in HTML or a similar mark-up language) from document presentation, including elements such as the colours, fonts, and layout.

There are various ways of linking these style rules to your HTML documents, but the simplest method for starting out is to use HTML's STYLE element. This element is placed in the document HEAD, or by using the Style property of an individual tag, e.g. h1. The style element contains the style rules for the page. But the most common way of using a Style element is by putting it into a external Style sheet. A file with css extension. This is then linked to the HTML page.