Css Selectors Flashcards

1
Q

Css Selectors

A

In CSS, selectors are patterns used to select the element(s) you want to style.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Type selector

A

select elements by type ex: table{color:red}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Class selector

A

select elements by class .table{color:red;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Id selector

A

select elements by id #table{color:red;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

attribute selector

A

select by attribute, [data-author]{color:red;} can you wildcard characters to select,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

selector chaining

A

use commas to chain selectors table, ul

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Psuedo-elements

A

used to add special effects to some selectors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Css combinators

A

combining simple selectors so they apply to targeting section

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is data dash and why is it important

A

new feature to html 5 any that gives the ability to create custom attributes as long as they begin with data-
ata- attributes as a mechanism for applying metadata to elements. It turns out that this metadata is also useful when selecting elements. The browser does not use data- attributes when rendering the page. This means that they can be used to select elements independently of the element hierarchy and styling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the 3 types of css positioning

A

relative, absolute and fixed, static is the default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Position:Static

A

the element is not positioned may be used to override positioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Postion:Relative

A

then you can use top or bottom, and left or right to move the element relative to where it would normally occur in the document.

What it really means is “relative to itself”. If you set position: relative; on an element but no other positioning attributes (top, left, bottom or right), it will no effect on it’s positioning at all, it will be exactly as it would be if you left it as position: static;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Position:Absolute

A

the element is removed from the document and placed exactly where you tell it to go

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are two other things that happen when you set position: relative?

A

One is that it introduces the ability to use z-index on that element, which doesn’t really work with statically positioned elements. Even if you don’t set a z-index value, this element will now appear on top of any other statically positioned element. You can’t fight it by setting a higher z-index value on a statically positioned element. The other thing that happens is it limits the scope of absolutely positioned child elements. Any element that is a child of the relatively positioned element can be absolutely positioned within that block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Position:Fixed

A

This type of positioning is fairly rare but certainly has its uses. A fixed position element is positioned relative to the viewport, or the browser window itself. The viewport doesn’t change when the window is scrolled, so a fixed positioned element will stay right where it is when the page is scrolled, creating an effect a bit like the old school “frames” days.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the four different ways to add color in css

A

named, rgb, slk and opacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Syntax for named color in css

A

color:red

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Syntax for hex color in css

A

color:#ffffff or color:fff when the pairs have the same number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Syntax for rgb color in css

A

takes 3 values rgb(0,255,0) red blue green this is what monitor display uses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Syntax for hsl color

A

hsl(hue, saturation, lightness) hsl(0, 50%, 50%)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are css text properties

A

text-decoration, text- transform, text shadow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

text-decoration

A

underlines text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

text-transform

A

transforms text to upper or lower case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are css font properties

A

font-style, font-variant, font-weight, font-size, font-family

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Font-style
sets the style of text normal, italic, oblique
26
font-variant
normal, small caps
27
What are the different ways to specify font sizes in css
name, lenght, and percentage
28
What is the default font size
named medium
29
What are the different font lenght allowed
px, cm
30
Write the syntax for font size for each type
font-size:100%, 10px, 50cm, small
31
What is text shadow
add a shadow to text requires a series of arguments and direction
32
Syntax for text shadow
text-shadow: #6374AB 20px -12px 2px; , shadow color, x coord, y coor, blur radius
33
line height
specifies line height, takes normal, a number, lenght(px, pt, cm) and percentage
34
where does the browser look for fonts
based on what is on the users machine you can specify the url for a font in css with @font-face
35
What is the font shorthand
shorthand way of applying css for all font properties
36
What are the font shorthand rules
his CSS shorthand version will only work if you're specifying both the font-size and the font-family. The font-family command must always be at the very end of this shorthand command, and font-size must come directly before this. Also, if you don't specify the font-weight, font-style, or font-variant then these values will automatically default to a value of normal, so do bear this in mind too. Example: font: bold italic small-caps 1em/1.5em verdana,sans-serif
37
what are css columns
set columns left to right on the page
38
What is the syntax for css columns
column width, column count
39
What are boxes in the css world
basically a div
40
What are properties that affect a box sized shape etc
border, padding and margin
41
Border
around the box px and color
42
Margin
space around the box
43
Padding
space in the div
44
Outline Offset
The outline-offset property offsets an outline, and draws it beyond the border edge.
45
Box sizing properties
width, height, min, max
46
What are some of the css visibility properties
display and visibility
47
Tell me more about the disply properties
has a possible of 4 values and I am unsure of what they all mean None - hides the div block - The element is displayed as a block-level element (like paragraphs and headers) inline-block-The element is placed as an inline element (on the same line as adjacent content), but it behaves as a block element inline- default the element is displayed inline like a span
48
Box Shadow
allows box shadow syntax box-shadow: 10px 10px 5px #888; Note: The box-shadow property attaches one or more drop-shadows to the box. The property is a comma-separated list of shadows, each specified by 2-4 length values, an optional color, and an optional inset keyword. Omitted lengths are 0.
49
Border Radius
Created rounded borders #example1 { border-radius: 15px; }
50
Gradients
Allows you to create gradients in css on elements
51
Linear
a function tht creates a image which represents a linear gradient of colors
52
child selector
#someDiv > p
53
example of chaining
div > div > p
54
adjacent sibling selector
p + p
55
syntax for asterik selector chaining
#someDiv *
56
What are link related psuedo selectors
visited, hover and active
57
What are input and link related psuedo selectors
focus, target, enabled, disabled, checked, intermediate
58
What are position number based pseudo class selectors
root, first-child, last-child, nth-of-type, first or type, last-of-type, nth-last-of-type, only-of-type,
59
Relational psuedo class selectors
not(S), empty
60
Text related psuedo classes
first-letter, first-line, lang, selection
61
Content type pseudo elements
before, after
62
What is the syntax for adding CSS Tina web page.
link='CSS path' rel='stylesheet' type='text/CSS'
63
What is the syntax for adding CSS Tina web page.
link='CSS path' rel='stylesheet' type='text/CSS'
64
Border css properties
border-style, border-width, border-color, border individual sides and border shorthand
65
Margin css properties
top, bottom, right, left you can use lenght, %, auto and inherit
66
Padding css properties
top bottom left right lenght and percentage
67
Margin
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once. Space outside the border
68
Padding
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element. The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once.
69
What is the css box model
All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout. The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content. The box model allows us to place a border around elements and space elements in relation to other elements.
70
Outline
An outline is a line that is drawn around elements (outside the borders) to make the element "stand out". The outline properties specify the style, color, and width of an outline.