Programming Exercises

Create a responsive div that adjusts its width to 50% of the screen.

Easy

Problem Statement

Create a responsive div that adjusts its width to 50% of the screen.

Sample Input

A webpage with a <div> element.

Sample Output

The div's width is 50% of the screen size.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<!DOCTYPE html> <html> <head> <style> /* Add CSS here to style the div */ </style> </head> <body> <div class="responsive-div">Content inside the div</div> </body> </html>
Log in or sign up to run or submit your code.Log inSign up
Input
A webpage with a <div> element.
Expected Output
The div's width is 50% of the screen size.