What does the following CSS media query do: @media (orientation: portrait) { ... }?
A). Applies styles when the device is in landscape mode
B). Applies styles when the device is in portrait mode
C). Applies styles regardless of orientation
D). Applies styles only to desktop devices
Why is it important to adapt layouts based on device orientation?
A). To increase server load
B). To provide an optimal viewing experience in both portrait and landscape modes
C). To restrict content visibility
D). To increase website complexity
How can touch events be handled in jQuery for responsive design?
A). By using .hover() method
B). By using .click() method
C). By using .swipe() method
D). By using .resize() method
Which jQuery method is used to change the source of an image dynamically?
A). .attr()
B). .html()
C). .css()
D). .val()
How does a fluid grid layout help in responsive design?
A). Provides a fixed layout
B). Uses relative units like percentages to adapt to different screen sizes
C). Limits the content to a fixed width
D). Hides content on smaller screens
Why is it important to use $(document).ready(function() { ... }); in jQuery?
A). To ensure the DOM is fully loaded before executing scripts
B). To increase script execution speed
C). To prevent scripts from running
D). To hide content until the user interacts with the page
What does the max-width property do in responsive design?
A). Sets a fixed width
B). Allows an element to shrink below a specified width
C). Ensures an element does not exceed a specified width
D). Hides an element if it exceeds a certain width
What is the primary purpose of responsive web design?
A). To make websites load faster
B). To make websites compatible with older browsers
C). To ensure websites render well on various devices and screen sizes
D). To reduce the amount of CSS required
How does display: none; help in responsive design?
A). It hides elements from the page completely
B). It makes elements visible only on small screens
C). It resizes elements
D). It changes the background color of elements
How can jQuery be used to toggle a navigation menu on small screens?
A). By using .hide() and .show() methods
B). By using .toggleClass() method
C). By using .slideToggle() method
D). By using .fadeIn() method