Mod 8 - Styling the Web Flashcards

1
Q

What is the general syntax for styling?

A

style=”property1: value1; property2: value2”

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

How would I change the size of font?

A

Use the styling format.

  1. Use px (ex. <b>word</b>)
  2. Use % (ex. <i>word</i>)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the span tag?

A

Can be used to modify text appearing within other text & is designed for elements flowing horizontally, but will do nothing on its own (used to style web pages).

ex. This is <span>text in a span</span> in a sentence.

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

What is the div tag?

A

It is similar to <span> but is for a vertical region/block of a web page (and is more flexible than <p> b/c it can be nested & contain non-textual elements).</span>

ex. </p><div style="font-style: italic; margin-left: 30px;">This is text inside of a div.</div></span>

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

Why are classes used?

A

They are more convenient as you don’t have to use a ton of <span> tags & change them all individually, you can just style the classes to change it. </span>

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

How is a class defined (referenced)?

A
There is always a period (.) before the class name when being referenced. It is always followed by { }. 
ex.

  .important{
  font-size: 125%; font-weight: bold; }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you name a class?

A
  1. For a small area of text use: span class=”important”>text /span>
  2. For large area of text (like a table) use: div class=”important”> ……. /div>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a CSS file?

A

Web developers often put all of their styling into a Cascading Style Sheet (CSS). The benefit of this is that multiple html files can use the same styling sheet to look consistent.

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

How do you use a CSS file?

A
.ClassA{
     property1: value1;
     property2: value2;
}
.ClassB{
     property1: value1;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you reference a CSS file in the HTML file?

A

link rel=”stylesheet” href=”filename.css”>

Use in header.
The link tag indicates that a separate file is being used. The href attribute specifies the file name. The rel attribute specifies that the file is a “style sheet”.

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

How do you specify attributes for tags?

A
Same as classes, just w/o the period.
ex. 
h1{
   font-size:200%;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you specify attributes for id’s?

A
Same as classes, just with a hashtag instead.
ex. 
#pagetop{
   font-size:200%;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is it called cascading?

A

Because it goes from the most general style to the most specific. If there are conflicting characteristics, the more specific one (specified in the tag) will be used.

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

What colours are used under the additive colour theory (computer colours)?

A

Red, green, blue (rgb). White is combo of all 3; black is absence of all 3. This method is time consuming, so often hex colours are used.

ex. <div style>This is white text on a black background</div>

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

How do hex colours work?

A

A hex code is given for rgb. It will either use a 3 or 6 digit code. 0=0% while F=100%

ex. black is: #000 or #000000; red is: #FF0000

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

Name some font properties.

A
  1. font-family (font name - ex. Times, etc.)
  2. font-size (px or %)
  3. font-style (normal, italic, oblique)
  4. font-weight (normal, bold, 900, etc.)
17
Q

Explain the layout properties.

A

Imagine each HTML element (letter, word, paragraph, etc.) as enclosed in a box & they all have properties. Each box has a margin, border and padding.
ex.
> border-color; border-width; border-style (dotted line, solid, etc); border-(top, right, bottom, left); padding-(t, r, b, l); margin-(t, r, b, l)

18
Q

What are some interactive properties you can do with links?

A
  1. a:link { color: #F2F; } (the link’s normal colour)
  2. a:visited { color: #22F; } (the link’s colour after you visit it)
  3. a:active { color: #2F2; } (colour after you first click it)
  4. a:hover { color: #F22; font-size: 125%; font-weight: bold} (colour when you hover over the link)
19
Q

What are some good design considerations?

A
  • proximity/separation
  • alignment
  • repetition
  • contrast
20
Q

Define proximity/separation

A

The closer items are, then they are more associated together & vice versa (paragraphs with two different ideas have notable space between them).
Think about placement of text & images as well as pick a focal point.

21
Q

Define alignment

A

Alignment shows association and provides better aesthetics.

ex. aligned list items

22
Q

Define repetition

A

Use creativity but keep in mind well-known structures/layouts.
ex. headlines above pictures, same fonts, horizontal writing
ex 2. similar colours, logos, etc. go together

23
Q

Define contrast

A

Easily distinguishable text from the background.