Images, Media & Forms Flashcards
(33 cards)
What is the purpose of using images in web development?
To enhance the visual appeal and user experience of a website.
What are the common image formats used in web development?
- JPEG
- PNG
- GIF
- SVG
Which image format is best for photographs?
JPEG
Which image format supports transparency?
PNG
True or False: GIF format supports animation.
True
Fill in the blank: The _______ attribute is used to specify an alternative text for an image.
alt
What is the role of the <img></img> tag in HTML?
To embed images in a webpage.
What attribute can be used to set the width of an image in HTML?
width
What attribute can be used to set the height of an image in HTML?
height
What does the ‘src’ attribute in the <img></img> tag specify?
The URL of the image.
What is the benefit of using CSS for styling images?
To separate content from design and allow for easier maintenance.
Fill in the blank: The _______ property in CSS can be used to control the display of images.
display
What is the function of the <figure> and <figcaption> elements in HTML?</figure>
To group images with their captions.
True or False: The <video> tag can be used to embed video content in a webpage.</video>
True
What attributes are commonly used with the <video> tag?</video>
- controls
- autoplay
- loop
- muted
What is the purpose of the <audio> tag in HTML?</audio>
To embed audio files in a webpage.
What attributes can be used with the <audio> tag?</audio>
- controls
- autoplay
- loop
- muted
Fill in the blank: The _______ tag is used to create forms in HTML.
form
What are the common input types in HTML forms?
- text
- password
- checkbox
- radio
- submit
What is the purpose of the ‘action’ attribute in a form?
To specify where to send the form data when submitted.
What does the ‘method’ attribute in a form define?
The HTTP method to use when submitting the form.
True or False: The ‘GET’ method appends form data to the URL.
True
True or False: The ‘POST’ method sends form data in the body of the request.
True
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?
img { max-width: 100%; height: auto; }
This ensures the image scales down if needed but keeps its original proportions.
