Complete the code to add the viewport meta tag for responsive design in a WordPress theme header.
<meta name="viewport" content="width=[1], initial-scale=1">
The viewport meta tag uses device-width to make the page width match the device's screen width, enabling responsive layouts.
Complete the CSS media query to apply styles only on screens smaller than 768px.
@media only screen and (max-[1]: 768px) { /* styles here */ }
The max-width media query targets screen widths up to 768 pixels, commonly used for tablets and smaller devices.
Fix the error in the WordPress function to enqueue a responsive stylesheet.
function theme_enqueue_styles() {
wp_enqueue_style('responsive-style', get_template_directory_uri() . '/css/[1].css');
}
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');The CSS file is named 'responsive.css' in the theme's css folder, so the correct filename is 'responsive'.
Fill both blanks to create a responsive image tag in a WordPress theme using srcset and sizes attributes.
<img src="image-small.jpg" srcset="image-small.jpg 480w, image-large.jpg [1]" sizes="(max-width: 600px) [2], 100vw" alt="Responsive image">
The srcset attribute uses '800w' to indicate the width of the large image. The sizes attribute uses '100vw' to specify the image should take full viewport width beyond 600px.
Fill all three blanks to create a responsive navigation menu in WordPress using a toggle button and ARIA attributes.
<button aria-[1]="primary-menu" aria-[2]="false" id="menu-toggle">Menu</button> <nav id="primary-menu" class="menu" [3]="navigation">...</nav>
The button uses aria-controls to link to the menu, aria-expanded to indicate toggle state, and the nav uses role="navigation" for accessibility.