CSS Flashcards

1
Q

CSS is a visual markup and adds Semantics to XML.

How do you include CSS to your XML document?

A

By inserting it as a processing instruction.

The first attribute indicates we are using the CSS language

The second attribute gives the location

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

What are selectors and declarations in CSS?

A

Selectors should refer to paths in a tree and be able to test attribute value

Declarations should be able to state what visual property is being changed & the value

selector { declaration; …; declaration; }

declaration = property : value

Tip: Declarations should filtered down the document tree (parent and it’s children)

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

What is the difference between universal and type selectors?

A

Universal selector matches the name of any element

* { font-size: 24pt; }

Type selector matches the name of a document language element

TITLE { font-size: 24pt; }

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

What are the two descendant selectors and how do they work?

A

Descendant selector combines elements seperated by a space. Amends the final element (in terms of the declaration) if it is any descendant of the previous element.

CONTACT TEL {color:orange;}

Tip: Can combine with universal selectors A * D { color:red; }

Child Descendant selector only matches direct descendants (children)

CONTACT > TEL { font-size: 24pt; }

Tip: Can combine both types CONTACT > TEL HOME

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

What are the two common attribute selectors?

A

[att] matches when the element sets the [att] attribute

[att=”val”] matches when the element sets the [att] attribute with the value “val”

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

What are Pseudo Classes and Pseudo Elements

A

They are based on information outside the document tree

selector:pseudo {declarations}

Pseudo Elements refer to structural information which

isn’t marked up but still useful

OPENING:before {content: “Dear”}

CLOSING:after {content: “Kindest Regards”}

Pseudo Classes specify other characteristic properties of elements

[e.g hover & active]

HIDING:hover {declarations}

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

Name some relative units

A
  • em: the ‘font-size’ of the relevant font
  • ex: the ‘x-height’ of the relevant font
  • px: pixels, relative to the viewing device
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Name some absolute units

A
  • in: inches
  • cm: centimeters
  • mm: millimeters
  • pt: points
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the Limitations to CSS?

A
  • Can’t Restructure a document
    Unable to sort or convert logical elements to a table (html recipe example)
  • Can’t Remove a document
    Can hide with display:none but it won’t actually remove the data. Still can see in the source code
  • Can’t Compute using the data content or its structure
    Unable to use the output data, sort, make ENUMs. (Can count with xslt)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly