Web Technology MCQs (Set-1)

Difficulty: Mixed

What does HTML primarily define?

A Visual color palette
B Database storage
C Web page structure
D Network routing

Which element represents the main page content?

A <footer>
B <main>
C <aside>
D <title>

Why use semantic HTML elements?

A Replace every CSS rule
B Encrypt page content
C Store user passwords
D Improve meaning and navigation

Which technology styles a web page?

A CSS
B HTTP
C DNS
D JSON

What does the CSS box model include?

A Header, body, footer, script
B Content, padding, border, margin
C Host, path, query, fragment
D Request, response, status, header

How does a class selector target elements?

A By matching page titles
B By matching server ports
C By matching file sizes
D By matching class names

What is a media query commonly used for?

A Applying styles by conditions
B Sending data to servers
C Creating database tables
D Encrypting browser cookies

Which CSS layout tool arranges items along axes?

A DNS
B JSON
C Flexbox
D TLS

When is CSS Grid especially useful?

A For resolving domain names
B For encrypting network traffic
C For parsing JSON
D For two-dimensional layouts

What does JavaScript commonly add to web pages?

A Domain registration
B Interactive behavior
C Physical storage
D Screen hardware

How can a script respond to a button click?

A Change the DNS record
B Open a database port
C Register an event listener
D Edit the image pixels

What does DOM represent in browser scripting?

A Document Object Model
B Data Output Method
C Domain Order Map
D Device Operating Mode

Which format represents structured data as text?

A JSON
B JPEG
C MP3
D PNG

How does the Fetch API commonly obtain web resources?

A It styles page headings
B It resizes image files
C It registers domain names
D It sends network requests

What is HTTP used for on the web?

A Drawing page borders
B Exchanging request and response messages
C Storing passwords locally
D Compressing image pixels

Which HTTP method is typically used to retrieve a resource?

A POST
B PATCH
C GET
D CONNECT

When is POST commonly used?

A Retrieving a page title
B Submitting data for processing
C Resolving a domain name
D Styling a form field

What does HTTPS add to HTTP connections?

A TLS protection in transit
B Automatic database backups
C Guaranteed user anonymity
D Permanent browser storage

Which service maps domain names to network records?

A CSS
B DOM
C SVG
D DNS

Which parts are commonly found in a URL?

A Font, color, and margin
B User, group, and role
C Scheme, host, and path
D Table, row, and column

What can a browser cookie store?

A Small site-related data
B Entire video libraries
C Operating-system drivers
D Public DNS zones

How does localStorage generally differ from sessionStorage?

A It exists only on servers
B Stores credentials automatically
C It persists across browser sessions
D It clears after every keystroke

What does CORS control?

A CSS color inheritance
B Image compression ratios
C Cookie expiration dates
D Cross-origin browser access

What does an API provide to software?

A A larger display area
B A defined interaction interface
C A permanent network address
D An image file format

Which payload format is common in web APIs?

A BMP
B WAV
C JSON
D TIFF

In a client-server model, what does the client do?

A Assigns public domain names
B Maintains all global standards
C Manufactures network cables
D Requests a service or resource

Where does front-end code usually run?

A Only on a DNS server
B In the user’s browser
C Inside a database engine
D On a router’s firmware

Which browser tool helps inspect network requests?

A Developer Tools Network panel
B Taskbar volume control
C File Explorer preview
D Printer settings dialog

Why defer off-screen image loading?

A To increase DNS records
B To disable keyboard input
C To enlarge every image
D To reduce initial page work

What can browser caching reduce?

A Repeated resource downloads
B HTML semantic structure
C User authentication checks
D Keyboard focus order

How can users navigate a site without a mouse?

A Using image compression
B Using domain registration
C Using keyboard controls
D Using server logs

Which heading structure best supports document navigation?

A Random font-size changes
B Meaningful nested headings
C Bold paragraphs only
D Images without captions

What should useful image alternative text convey?

A Every pixel’s color value
B The image’s relevant meaning
C The server’s file directory
D The camera’s serial number

Why associate a form label with its input?

A To compress submitted data
B To add a database index
C To hide field validation
D To identify the input clearly

Which practice improves text readability?

A Smaller text everywhere
B Color-only instructions
C Sufficient foreground contrast
D Removing visible focus

How can responsive images adapt to different screens?

A Serve suitable image sources
B Change the DNS provider
C Disable browser caching
D Remove image descriptions

What is an advantage of SVG graphics?

A They require no markup
B They store relational tables
C They replace HTTP requests
D They scale without pixelation

Where does WebAssembly run in a web application?

A Inside a CSS selector
B In a compatible web runtime
C Only in a database server
D In a domain registrar

What can a service worker help a web app do?

A Handle selected tasks in background
B Style every HTML element
C Register a top-level domain
D Replace the browser engine

How can developers reduce DOM-based cross-site scripting risk?

A Trust every query parameter
B Disable all HTML escaping
C Treat untrusted input safely
D Store scripts in cookies

What does a Content Security Policy help restrict?

A User screen brightness
B Domain registration fees
C Database table names
D Allowed content sources

Which attack can exploit a user’s authenticated browser session?

A Image scaling failure
B DNS cache warming
C Cross-site request forgery
D CSS selector mismatch

What does input parameterization help prevent?

A Image blurring
B SQL injection
C Color contrast loss
D URL shortening

How do authentication and authorization differ?

A Identity versus permitted actions
B Encryption versus compression
C Styling versus scripting
D Caching versus routing

What does a content delivery network distribute?

A Database schemas to browsers
B Passwords across websites
C Content from nearby edge servers
D HTML tags to domain registrars

Why use a load balancer?

A Replace every database backup
B Distribute requests across servers
C Translate CSS into HTML
D Issue browser permissions

Which technology supports two-way web communication over one connection?

A CSS Grid
B DNSSEC
C JPEG
D WebSocket

What does HTTP status code 404 indicate?

A The resource was not found
B The request succeeded
C The server is restarting
D The client is unauthorized

Why publish an XML sitemap?

A Encrypt a login form
B Compress CSS files
C Help crawlers discover URLs
D Set browser permissions

What can structured data help search engines understand?

A The user’s private password
B Details about page content
C A server’s power supply
D The browser’s screen brightness