Chapter 4 : Introduction to CSS Flashcards

1
Q

What is the full name of css?

A
  1. Cascading Style Sheets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why do we need to use CSS?

A
  1. To seperate structure ( HTML ) from presentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does a style sheet contain?

A
  1. A style sheet contains instructions that define how to display HTML elements in a web page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the file format for an external style sheet?

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

List out 3 types of CSS

A
  1. Inline
  2. Embedded
  3. External
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What element that inline styles declares? ( 2 )

A
  1. Indicidual element’s format
  2. A one-time style instruction placed in an individual HTML tag

< p style=”font-size: 20pt; color: #ffffff”>< / p >

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

What is the disadvantages of using inline styles? ( 2 )

A
  1. Not taking the full advantage of the true power of CSS
  2. Not separating content from presentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Where is embedded style sheets declared?

A
  1. In HTML’s < head > section
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

List out some CSS property ( 4 )

A
  1. Multipurpose Internet Mail Extensions ( MIME ) Type
    • Describes a file’s content
  2. background-color
  3. font-family
  4. font-size
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which HTML file that embedded style sheets effects?

A
  1. The style of the page on which it is written

<style>

     h1 { font-size : 30px }
</style>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What can external style sheets do?

A
  1. Provide uniform look and feel to entire site
  • One external style sheet can control the appearance of many web pages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the advantages of using an external style sheets?

A
  1. Maintain a consistent look across all pages that link to the style sheet
  2. Easily update the look of all pages by changing the values in one file
  3. Make your pages much smaller and quicker to download, because all of the style information has been removed to one file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to refer the HTML file to use the external style sheets?

A

<link></link>

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

What will happen when multiple style instructions exist?

A
  1. It will “cascade” into a single set of instructions, with some instructions taking priority over others
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List out the priority for CSS styles ( 4 )

A
  1. Inline Styles
  2. Embedded Style Sheet
  3. External Style Sheet
  4. Browser Default
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What will happen when 2 styles applied to the same text?

A
  1. The browser displays all attributes of both styles unless specific attributes conflict
17
Q

What will HTML formatting do to CSS formatting?

A
  1. It wil override any CSS formatting
18
Q

What will implement CSS differently? What is the best practices to address this issue?

A
  1. Different Browsers
  2. Test your web pages in a variety of browsers to make sure your pages display correctly
19
Q

What will happen if attributes from 2 styles applied to the same text conflict?

A
  1. The browser displays the attribute of the innermost style ( The style closest to the text itself )
20
Q

What is a HTML selectors?

A
  1. Are the text part of a HTML tag and are used to define the behavior of the specific HTML tag
  • h1 is the selector for <h1> tag
  • Although HTML tag and the selector appear to be identical, they are not the same
  • The HTML selector is used to control the behavior of its specific HTML tag
  • h1 { font-family: arial, sans-serif }
21
Q

List out 2 selectors for CSS Styling

A
  1. HTML selectors
  2. Class selectors
22
Q

What does class selectors do?

A
  1. Are selectors that you create from scratch
  2. They can be applied to any HTML tag

.userDefineName { font-size: 14pt, color: blue }