HTML & CSS- part 4 Flashcards

1
Q

What are the usual measurements for borders, padding, and margins?

A

Borders are pixels
Padding and margins are EMs

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

If you want <h1> and <p> to share characteristics, what’s the best way to code that?

A

h1, p { characteristics to be shared }

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

If you group two element types together to give them the same characteristics, how does that affect the characteristics you don’t declare?

A

It doesn’t. Two grouped elements only share the traits you declare. You are still free to specify differences in other traits.

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

How is an ID different from a class?

A

An id is more exclusive.

It can be assigned only once in an HTML document.

And an element, though it can have many classes, can have only one ID.

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

Where a class uses a period right before the name, what does an ID use?

A

#

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

What a DIV?

A

A section of a web page. It behaves like any other element.

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

When might a coder use a DIV?

A
  • headers
    *navigation bars
    *main content
    *footers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are DIVs formatted?

A

Usually each will have its own class or ID

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

How do you code a DIV?

A

<div>
</div>

Essentially the same as any other element, except it almost always has its own class or ID>

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

Why do some HTML tags need a closing tag while others don’t?

A

Generally, the ones that need a closing tag have content, like <h2> or <p>; the ones that don’t have a closing tag usually don’t have content (like <br></br>)

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

Why do some people write <br /> for a linke break or <hr /> for horizontal rule?

A

You used to have to write these tags like this if you didn’t have a closing tag, but you don’t have to do this anymore.

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

What is an attribute in HTML?

A

A little more info inside the tag to help the browser. So for <img> you would include the source, which is the attribute:
<img src=”wherever.jpg”>

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

What are the three main image types?

A

JPG, GIF, and PNG

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

What’s the JPG format best for?

A

The jpg format is best for photographs and for illustrations with many subtle colors.

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

What’s the GIF format best for?

A

*Usually just animation. Besides animation, PNGs do everything a GIF does better and with a smaller file

*It can be used for line drawings, illustrations with just a few colors, and images of text.

*offer transparency, meaning that the background color can show through wherever you want it to.

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

What is a block element?

A

It means the browser doesn’t put any other element beside it,

17
Q

Give some examples of block elements.

A

headings
paragraphs
lists
tables
divs

18
Q

What’s the opposite of a block element?

A

Inline element

19
Q

Are imagines block elements or inline elements?

A

Inline elements

20
Q

How can you convert an image to a block element?

A
21
Q

What are the two options for DISPLAY in CSS?

A

block
inline

22
Q

What are the three attributes you should have in an <img> tag?

A

*src= the source of the image
*alt = alternate text in case the image cannot be loaded
*width & height= gives the browser a head start on loading the pictures

23
Q

Can you scale an image in the image tag?

A

Yes, by changing the width and height attributes.

However, scaling up usually results in a lower quality image.

Scaling of any kind slows down the loading a little bit