Images, Media & Forms Flashcards

(33 cards)

1
Q

What is the purpose of using images in web development?

A

To enhance the visual appeal and user experience of a website.

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

What are the common image formats used in web development?

A
  • JPEG
  • PNG
  • GIF
  • SVG
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which image format is best for photographs?

A

JPEG

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

Which image format supports transparency?

A

PNG

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

True or False: GIF format supports animation.

A

True

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

Fill in the blank: The _______ attribute is used to specify an alternative text for an image.

A

alt

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

What is the role of the <img></img> tag in HTML?

A

To embed images in a webpage.

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

What attribute can be used to set the width of an image in HTML?

A

width

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

What attribute can be used to set the height of an image in HTML?

A

height

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

What does the ‘src’ attribute in the <img></img> tag specify?

A

The URL of the image.

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

What is the benefit of using CSS for styling images?

A

To separate content from design and allow for easier maintenance.

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

Fill in the blank: The _______ property in CSS can be used to control the display of images.

A

display

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

What is the function of the <figure> and <figcaption> elements in HTML?</figure>

A

To group images with their captions.

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

True or False: The <video> tag can be used to embed video content in a webpage.</video>

A

True

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

What attributes are commonly used with the <video> tag?</video>

A
  • controls
  • autoplay
  • loop
  • muted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the <audio> tag in HTML?</audio>

A

To embed audio files in a webpage.

17
Q

What attributes can be used with the <audio> tag?</audio>

A
  • controls
  • autoplay
  • loop
  • muted
18
Q

Fill in the blank: The _______ tag is used to create forms in HTML.

19
Q

What are the common input types in HTML forms?

A
  • text
  • password
  • checkbox
  • radio
  • submit
20
Q

What is the purpose of the ‘action’ attribute in a form?

A

To specify where to send the form data when submitted.

21
Q

What does the ‘method’ attribute in a form define?

A

The HTTP method to use when submitting the form.

22
Q

True or False: The ‘GET’ method appends form data to the URL.

23
Q

True or False: The ‘POST’ method sends form data in the body of the request.

24
Q

You have an <img> inside a container that has max-width: 800px. The image is larger than this container. What CSS rules should you apply to ensure the image never overflows while maintaining its aspect ratio?

A
img {
  max-width: 100%;
  height: auto;
}

This ensures the image scales down if needed but keeps its original proportions.

25
You want a background image to always cover an entire `
` but prevent distortion. Which CSS property ensures this behavior?
`background-size: cover;` ## Footnote This makes the image cover the whole element while maintaining its aspect ratio, though some parts may be cropped.
26
You're embedding a `
``` video { max-width: 100%; height: auto; display: block; } ``` ## Footnote This makes the video adapt to the container while keeping its proportions.
27
What’s the best way to associate a `
``` ``` ## Footnote Using the for attribute links the label to the input, making it clickable and improving accessibility for screen readers.
27
How can you change the color of placeholder text inside an` ` field?
``` input::placeholder { color: gray; font-style: italic; } ``` ## Footnote This targets the placeholder text specifically.
28
How do you make an `