IES: CSS-deck 1 Flashcards
1
Q
CSS
A
- Cascading Style Sheets
- A language used to control the presentation of elements within HTML documents
- Universally accepted style sheet language by all modern web browsers
2
Q
CSS assignment
q
A
- inline: style attributes
- internal rules: within style tags in the HTML head
- external rules: Within a style sheet attached to the HTML document
3
Q
CSS creator
A
- W3C
- To regain control of the burgeoning document markup and progressing style markup
4
Q
CSS benefits
A
- distinguishes between structural and presentational document aspects
- Easier maintenance
- Smaller file sizes
- Greater control
5
Q
Cascade
A
- determines which style rule will have precedence
- Determines which style rule will be applied to an HTML element
- (inline rules may override those specified by other style sheets)
6
Q
3 basic types of style sheet
A
- browser (default): intrinsic set of style rules used by browsers (small variances between different browsers)
- User: custom style sheet-overrides browser style sheet (some browsers allow)
- Author: HTML doc specifies a style sheet by web page author- overrides browser and user style sheets
- (inline rules may override those specified by other style sheets)
7
Q
CSS style rule main parts
A
- selector
- Declaration block
8
Q
selector
A
- specifies which HTML doc element a rule targets
- When specifying a Target element, you target every element of that type
- Everything before the Declaration block’s opening brace
- Multiple element types can be targeted by listing them in the selector area separated by commas
9
Q
declaration block
A
- specifies the style properties of a targeted element
10
Q
style rule setup
A
- line begins with the selector
- followed by the Declaration block within a pair of curly brackets or braces
- braces contain 1 or more declarations
- Each declaration specifies: a property (followed by a colon), a valid property value (Followed by a semicolon)
11
Q
CSS property: color
A
- determines font color
12
Q
CSS property: background-color/ background
A
- determines the color immediately behind a font/ line of font
13
Q
white space within style rules
A
- permitted: to allow author formatting preference
14
Q
Viewport
A
- within a meta tag
<meta name="viewport" content="width=device-width, initial scale=1.0">
15
Q
External style sheet
A
- a file separate from the HTML document which holds style rules
- great to maintain consistent Styles across web pages
<link rel="stylesheet" href="external.css" type="text/css">
16
Q
m
width
A
- sets the width of the targeted element
- May use percentages, pixels, etc.
17
Q
CSS: *
A
- the CSS Universal selector
- a selector that selects elements of all types within an HTML document
- Has a zero specificity value of 0, 0, 0, 0
18
Q
(element) *
A
- selects elements of any type contained within the specified element type
19
Q
CSS selector: .
A
- class selector
- Selects elements containing matching class attribute values
- Examples: .sorta matches elements with class= “sorta”; div.sorta matches div elements with class= “sorta”
- (if two rules select the same element, the rule which includes more specificity will be applied)
20
Q
ID selector
A
- selects elements the matching ID attribute
- begins with a # followed by the matching ID value
- (each ID attribute value must be unique within the HTML doc)
- An identity selector can be combined with a type selector
- If an element is identified by both a class and in ID selector, the ID selector will be applied as it is more important