Basic HTML | Working with media Flashcards
What is a replaced element?
An element whose content is determined by an external resource rather than by CSS itself.
What is CSS used for?
To add styles to a web page.
Name three common examples of replaced elements.
- Image
- Iframe
- Video
Can CSS modify the content of a replaced element?
No, CSS cannot directly modify the content of a replaced element.
What does the image element do?
Embeds an image on your web page.
Provide an example code for an image element.
<img></img>
What does the iframe element do?
Embeds an external site on your web page.
Provide an example code for an iframe element.
<iframe></iframe>
What can CSS control regarding replaced elements?
CSS can control the positioning of the element and apply filters.
Can CSS style the contents of an embedded site in an iframe?
No, CSS cannot style the contents of an embedded site.
Name two other replaced elements besides image and iframe.
- Video
- Embed
Under what circumstances can some elements behave as replaced elements?
When they have specific attributes, such as the input element with the type attribute set to image.
Provide an example code for an input element considered a replaced element.
<input></input>
Are input types like text or email considered replaced elements?
No, they are not considered replaced elements.
What are the three tools to consider when using media like images on web pages?
The size, the format, and the compression.
What does the resolution 640x480 represent?
640 represents the width and 480 represents the height in pixels.
Why is it important to match the image size to the styled size on a website?
To avoid requiring users to download unnecessary data.
What is the effect of serving a larger image than the styled size?
It results in a larger file size and unnecessary data download.
What are two common file formats for images?
PNG and JPG.
What are more optimized image formats to consider instead of PNG and JPG?
WEBP and AVIF.
What is the purpose of a compression algorithm in image processing?
To reduce the size of files or data.
Name a tool that can be used to compress images locally.
pngcrush.
What does lossless compression mean?
The original data can be perfectly reconstructed from the compressed data.
What happens when you compress a JPG image?
It results in degraded quality.