Very basic problem ...

flyankur
avatar
rank newbie

newbie


Posts: 1
Joined: 2008-10-12
Location: india

hi everyone,
I am new to CSS , i had some querries, which i couldnot find ealiy

what does following of them mean

1. .s .h{bla bla }; why is .s in front of it, and how to does it affect the <div class="s" ><div class ="h"></div<div>

2. In recent snippets i found code like div.bbr { ... } , whats the use of div here?? or it that any other keyword can be used .. ny ways what does it signifies.

Thanx a lot

Hugo
Hugo's picture
rank Moderator

Moderator


Posts: 12570
Joined: 2004-06-06
Location: London

The first is a type of

The first is a type of combinator selector (where two selectors are separated by white space) and you would find reference to it in any half decent guide on CSS selectors; it's called a 'descendent' selector and is the mainstay for applying rules to a particular element, if you google on descendent selectors you should find further reading which will explain in fuller detail than we can here and this is an important selector to understand as it is used a lot.

The second simply says that the named class is applicable when found on a div element, it restricts the class to only being effective on a certain element, where leaving of the element allows the class to be applied to any element in the markup

Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me