Developing ASP.NET MVC Web Applications — Question 68
You are developing an ASP.NET MVC application. Devices that use many different browsers will use the application.
You have the following requirements:
✑ Content must display correctly when a device is in landscape or portrait orientation.
✑ Content must not scale when the device orientation changes.
✑ Content must be displayed by using the maximum available screen space.
✑ The application must render properly in Internet Explorer 8 or later versions.
You need to configure the application.
Which two actions should you perform? Each correct answer presents part of the solution.
Answer options
- A. Use JavaScript to evaluate the window.innerWidth and window.innerHeight properties.
- B. Set the value of the width property for the viewport meta tag to device-width.
- C. Use CSS to target the HTML element on each page. Set the values of the width and height properties to 100%.
- D. Use CSS media queries to target screen size, device orientation, and other browser capabilities.
Correct answer: B, D
Explanation
The correct answers are B and D. Setting the viewport meta tag's width to device-width ensures that the content uses the full width of the device screen without scaling, while utilizing CSS media queries allows for targeted adjustments based on screen size and orientation. Options A and C do not directly address the requirements of maintaining proper display and orientation handling.