What are the different ways to apply a CSS rule to a specific media type?
Instruction: Discuss the methods to use CSS for styling specific media types.
Context: This question tests the candidate's knowledge of responsive design techniques, specifically the use of media queries to apply CSS rules based on media type and characteristics.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Use @media inside a stylesheet or a media attribute on a stylesheet link/style element. A media type such as screen or print can be combined with feature conditions. Omitting the type means all media, subject to the conditions.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS example</title> <style> body { color: #222; background: #fff; } @media screen and (min-width: 700px) { .summary...