0
0
Bootsrapmarkup~10 mins

Ratio utilities for embeds in Bootsrap - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a responsive 16:9 video embed using Bootstrap ratio utilities.

Bootsrap
<div class="ratio [1]">
  <iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" title="YouTube video" allowfullscreen></iframe>
</div>
Drag options to blanks, or click blank then click option'
Aratio-4x3
Bratio-16x9
Cratio-1x1
Dratio-21x9
Attempts:
3 left
💡 Hint
Common Mistakes
Using ratio-4x3 which is for older TV screens.
Forgetting to add the ratio class before the ratio size.
2fill in blank
medium

Complete the code to create a square (1:1) responsive embed container.

Bootsrap
<div class="ratio [1]">
  <iframe src="https://player.vimeo.com/video/76979871" title="Vimeo video" allowfullscreen></iframe>
</div>
Drag options to blanks, or click blank then click option'
Aratio-1x1
Bratio-16x9
Cratio-4x3
Dratio-21x9
Attempts:
3 left
💡 Hint
Common Mistakes
Using ratio-16x9 which is rectangular.
Not including the ratio base class.
3fill in blank
hard

Fix the error in the code to properly apply Bootstrap ratio utilities for a 4:3 embed.

Bootsrap
<div class="ratio [1]">
  <iframe src="https://www.example.com/embed" title="Example embed" allowfullscreen></iframe>
</div>
Drag options to blanks, or click blank then click option'
Aratio4x3
Bratio-16x9
Cratio-4x3
Dratio_4x3
Attempts:
3 left
💡 Hint
Common Mistakes
Using ratio4x3 without a hyphen causes the class to not apply.
Using underscores instead of hyphens.
4fill in blank
hard

Fill both blanks to create a responsive embed with a 21:9 ratio and add a border using Bootstrap classes.

Bootsrap
<div class="ratio [1] border [2] p-3">
  <iframe src="https://www.example.com/embed" title="Wide embed" allowfullscreen></iframe>
</div>
Drag options to blanks, or click blank then click option'
Aratio-21x9
Bborder-primary
Cborder-secondary
Dratio-16x9
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up ratio classes and border classes.
Using a ratio class that doesn't match the desired aspect ratio.
5fill in blank
hard

Fill all three blanks to create a responsive 4:3 embed with a shadow and rounded corners using Bootstrap classes.

Bootsrap
<div class="ratio [1] shadow [2] rounded [3]">
  <iframe src="https://www.example.com/embed" title="Styled embed" allowfullscreen></iframe>
</div>
Drag options to blanks, or click blank then click option'
Aratio-4x3
Bborder
Cborder-success
Dborder-danger
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the base border class.
Using a border color class without the base border class.