CSS3 - Sheet1 Flashcards
What is a Selector?
A selector is a tag, pseudo class or pseudo element that selects one or more elements of the document for formating.
What is a Declaration Block?
A declaration block constains the one or more formating instructions for the element(s) selected by the Selector.
The declarion block begins with a { and ends with a }.
What is a Declaration?
A declaration is a formating instruction
A Type selector is also know as …?
An elemement selector
Describe the Class selector and its syntax
Syntax: .ClassName The class selector selects an element based on the class attribute's value
Why would use multiple Class names in HTML's class attribute? What's the syntax?
This approach allows you to group common styles in a base style definition and enchance the definition for more specific cases. Syntax: .... List the class names separated by spaces. CSS will combine the class names to create a single style.
Describe the ID selectorand its syntax
Syntax: #IDName
The ID selector selects an element based on the value of the ID attrbibute
Describe the Group selector and its syntax
Syntax: Tag1, Tag2, .ClassName, #IDName {…}
List the selectors separated by commas.
The Group selector allow you to apply a single style to multiple selector types.
Describe the Attribute selector and its syntax
Syntax: Type | Class selector[ attributename [= value] ]
The attribute selector selects an element based on the attributes name and optionally the attributes value.
The attribute selector works with Type and Class selectors to refine the selection.
The atrribute selector supports value filtering
Begins with ^ - tagname^ = “value”
Ends with $ - tagname$ = “value”
Contains * - tagname* = “value”
Describe the universal selector and its syntax
Syntax: *
The Universal selector selects all elements on a page or within the defined scope.
The Universal selector can be used with the descendant selector.
Some web designers use the Universal selector to remove/reset the spacing on a page.
Describe the Descendent selector and its syntax
Syntax: Selector1 Selector3 Selector5 {…}
The Descendent selector selects items whose ancestors match the listed selectors.
Ancestor selectors do not have to be immediate parents of the listed child selector.
Describe the Child Selector and its syntax
Syntax: selector1 > selector2 [ > selector3]
The Child selector selects child items based on their parent items.
The > acts as a child selector. Examples: H1>P, H2>Article>Section
Describe the Child Selector pseudo-classes
The Child Selector supports the following psuedo-classes
:First-Child
:Last-Child
:Only-Child
:Nth-Child( odd | even | 0-9 | 0-1n [+ StartingElemenetNumber] )
type:First-of-Type
type:Last-of-Type
type:Nth-of-Type( odd | even | 0-9 | 0-1n [+ StartingElemenetNumber] )
Is the following legal? Nth-Child( -4n+10)?
Yes. It means select the 10th child and and then every 4th child item before it
What is a Child Type selector?
It’s a child selector that allows you to specify the child item’s type