Questions
HTML questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Export HTML Canvas to PNG, JPEG, GIF, and PDF with JavaScript
Learn how to export HTML canvas drawings as PNG or JPEG using toBlob and toDataURL, handle CORS safely, and create PDFs in JavaScript.
Fix CSS MIME Type text/html Errors in Gulp and BrowserSync
Learn why browsers reject CSS served as text/html, how to diagnose the response, and fix paths, server roots, and Gulp BrowserSync setup.
Get Screen, Page, and Browser Window Size in JavaScript
Learn how to get screen size, viewport size, page size, and scroll position in JavaScript across major browsers.
Get the Selected Radio Button Value with jQuery
Learn how to find which radio button is selected in jQuery and get its value with simple examples and common mistakes.
HTML <b>, <strong>, <i>, and <em>: Semantic Differences
Learn the semantic differences between HTML b, strong, i, and em tags, including accessibility, default styling, and when to use each correctly.
HTML <button> vs <input type="button">: Differences, Use Cases, and Best Choice
Learn the difference between HTML <button> and <input type="button">, when to use each, browser behavior, forms, and common mistakes.
HTML Character Encoding: `<meta charset="utf-8">` vs `<meta http-equiv="Content-Type">`
Learn when to use `<meta charset="utf-8">` versus `<meta http-equiv="Content-Type">` in HTML5 and why UTF-8 matters.
HTML Fragment Links: Using id vs name Anchors
Learn how HTML fragment links work and why id is the modern, semantic choice for linking directly to a section of a web page.
HTML Script async and defer Attributes Explained
Learn how HTML script async and defer affect downloading, execution order, parsing, dependencies, and page performance in modern browsers.
HTML id Attribute Rules: Valid Values and Best Practices
Learn which HTML id values are valid, how browsers treat them, and the best practices for naming ids in modern HTML and CSS.
HTML id vs name Attributes: Differences in Forms
Learn the difference between HTML id and name attributes, how forms submit values, and when using both attributes is necessary.
HTML role Attribute Explained: Accessibility, Semantics, and SEO
Learn what the HTML role attribute does, when to use it, how it affects accessibility, and whether it helps semantics or SEO.
HTML5 Number Input for Floating-Point Values
Learn how HTML5 input type="number" handles floating-point values, why browsers show integer steppers, and how to allow decimals correctly.
HTML5 Void Elements: Should You Use <br>, <br/>, or <br />?
Learn the correct HTML5 syntax for void elements like <br> and when <br/> or <br /> matters in HTML vs XHTML.
Hide a Scrollbar with CSS: Options, Accessibility, and Examples
Learn how to hide page and container scrollbars with CSS while preserving scrolling, including cross-browser rules and accessibility guidance.
Hide an Element When Clicking Outside in jQuery
Learn how to hide a div when clicking outside it in jQuery without breaking links or button clicks inside the element.
How In-Browser Screenshots Work with HTML5 Canvas and JavaScript
Learn how browsers create in-page screenshot tools with JavaScript and Canvas, including limits, selection overlays, and practical alternatives.
How `vertical-align` Works in CSS for Text Next to Images
Learn why `vertical-align: middle` may not work next to an image in CSS, how inline alignment works, and practical fixes for text-image layout.
How to Add a Class to an HTML Element with JavaScript
Learn how to add a CSS class to an HTML element in JavaScript using classList.add, with examples, mistakes, and real use cases.
How to Add a Favicon in HTML for Browser Tabs
Learn how to add a favicon to a website using HTML, choose PNG or ICO formats, place the tag in the head, and avoid browser caching issues.