diff --git a/curriculum/challenges/english/blocks/lecture-working-with-media/6716743531fc9a797351c21e.md b/curriculum/challenges/english/blocks/lecture-working-with-media/6716743531fc9a797351c21e.md index 8c25339a101..3428f7ca045 100644 --- a/curriculum/challenges/english/blocks/lecture-working-with-media/6716743531fc9a797351c21e.md +++ b/curriculum/challenges/english/blocks/lecture-working-with-media/6716743531fc9a797351c21e.md @@ -5,7 +5,7 @@ challengeType: 19 dashedName: what-are-replaced-elements --- -# --description-- +# --interactive-- A replaced element is an element whose content is determined by an external resource rather than by CSS itself. CSS, or cascading stylesheets, is used to add styles to a web page. Common examples of replaced elements include the image, iframe, and video elements. @@ -15,13 +15,38 @@ With replaced elements, you can control the position, or layout of an element. B Descriptive text goes here ``` -The element itself is replaced with the external object: the image. Your CSS can control things like the positioning of the image, or apply a filter to it, but you cannot actually modify the image itself. A more robust example might be the `iframe` element, which embeds an external site on your web page: +The element itself is replaced with the external object: the image. Your CSS can control things like the positioning of the image, or apply a filter to it, but you cannot actually modify the image itself. A more robust example might be the `iframe` element, which embeds an external site on your web page. + +Here is an example of using the `iframe` element for a popular YouTube video on the freeCodeCamp channel. If you want to see different videos in the preview window, change the value of the `src` attribute to a video of your choosing. + +**NOTE**: Don't worry about the extra attributes mentioned in the interactive example like `referrerpolicy` and `allowfullscreen`. You will learn more about working with `iframe` elements in a future workshop. + +:::interactive_editor ```html - + ``` -Common examples for using the `iframe` element would be to embed Maps or YouTube videos onto the page. The element itself is replaced with the external object: the site. Your CSS can change the positioning of the embedded site, but you cannot modify the site's contents. To dive a bit further, if the embedded site has an `h1` element, your CSS would not be able to style that `h1` element. You cannot change the size, font color, and so on. +::: + +Other common examples of using the `iframe` element would be to embed maps onto the page. Here is an example of an embedded map. + +Try playing around with the map itself by zooming in/out. + +:::interactive_editor + +```html + +``` + +::: + +The element itself is replaced with the external object: the site. Your CSS can change the positioning of the embedded site, but you cannot modify the site's contents. To dive a bit further, if the embedded site has an `h1` element, your CSS would not be able to style that `h1` element. You cannot change the size, font color, and so on. There are some other replaced elements, such as `video`, and `embed`. And some elements behave as replaced elements under specific circumstances. Here's an example of an `input` element with the `type` attribute set to `image`: