MCQs / Computer Science / Lab: Mobile-Friendly Web Page
Lab: Mobile-Friendly Web Page MCQs — Computer Science 14 multiple-choice questions on Lab: Mobile-Friendly Web Page from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
1. Removing the viewport meta tag on a phone makes the page: Switch to dark mode Larger and readable Render at desktop width and appear zoomed out Fail to load Answer: C) Render at desktop width and appear zoomed out
Explanation: Without the viewport, mobile browsers assume a wide desktop viewport.
Discuss this question
2. The alt attribute of an image is used for: Image rotation Alternative text for screen readers and when the image fails to load Image size Linking the image Answer: B) Alternative text for screen readers and when the image fails to load
Explanation: alt describes the image for accessibility and fallback.
Discuss this question
3. Which link opens the email app with the address filled in? mailto:cs@example.edu.pk smtp:cs@example.edu.pk email:cs@example.edu.pk send:cs@example.edu.pk Answer: A) mailto:cs@example.edu.pk
Explanation: The mailto: scheme opens the default email app.
Discuss this question
4. Which element creates a drop-down list? dropdown select with option elements datalist only list Answer: B) select with option elements
Explanation: select contains option elements to form a drop-down.
Discuss this question
5. Calling e.preventDefault() inside a form's submit handler: Resets the CSS Clears the form Validates the email Stops the browser from reloading the page / sending the form Answer: D) Stops the browser from reloading the page / sending the form
Explanation: preventDefault stops the default submit navigation so JavaScript can handle it.
Discuss this question
6. Which Chrome tool audits a page's mobile performance and accessibility? Gradle Postman Logcat Lighthouse Answer: D) Lighthouse
Explanation: Lighthouse in DevTools generates performance, accessibility, SEO and best-practice scores.
Discuss this question
7. To open a page served by Live Server on a phone, the phone must: Be rooted Have Android Studio Use mobile data Be on the same Wi-Fi network and use the PC's IP address Answer: D) Be on the same Wi-Fi network and use the PC's IP address
Explanation: Devices on the same local network can open http://PC-IP:port.
Discuss this question
8. Radio buttons belong to the same group when they share the same: id name value class Answer: B) name
Explanation: Radio inputs with the same name are mutually exclusive.
Discuss this question
9. The minimum recommended height of the submit button for touch is about: 200 px 48 px 10 px 20 px Answer: B) 48 px
Explanation: Touch targets should be at least about 48 px.
Discuss this question
10. Adding rel="noopener" to a link with target="blank" improves: Speed of images Font size Security of the original page Form validation Answer: C) Security of the original page
Explanation: noopener prevents the new tab from controlling the opening page.
Discuss this question
11. The loading="lazy" attribute on an image: Delays loading until the image is about to scroll into view Makes it blurry Converts it to WebP Hides it on phones Answer: A) Delays loading until the image is about to scroll into view
Explanation: Lazy loading saves data and speeds up the first page load.
Discuss this question
12. Which attribute restricts the phone field to the pattern 03 followed by 9 digits? pattern="03[0-9]9" maxlength="11" type="number" min="03" Answer: A) pattern="03[0-9]9"
Explanation: The pattern attribute validates the value with a regular expression.
Discuss this question
13. Which link format opens the phone's dialer? phone:0300... mailto:0300... call://0300... tel:+92300... Answer: D) tel:+92300...
Explanation: The tel: scheme opens the dialer with the number filled in.
Discuss this question
14. In the lab CSS, how many card columns appear at 700 px width? 2 1 4 3 Answer: A) 2
Explanation: At min-width 600px the grid has 2 columns; 3 columns start at 1024px.
Discuss this question
Practise Lab: Mobile-Friendly Web Page MCQs
More Computer Science chapters