Questions
HTML questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Align Checkbox and Label Text Consistently Across Browsers with CSS
Learn reliable ways to align checkbox inputs and labels across browsers using simple HTML and CSS techniques.
How to Align Content to the Bottom of a Div in CSS
Learn how to bottom-align content inside a fixed-height div using CSS with simple examples, flexbox, positioning, and common mistakes.
How to Allow Only Numeric Input in HTML and JavaScript
Learn how to allow only numeric input in HTML text fields, including decimals, validation, and safer alternatives for real forms.
How to Auto-Resize an Image While Maintaining Aspect Ratio in CSS
Learn how to resize images to fit a container while keeping aspect ratio using CSS. Includes examples, mistakes, and a mini project.
How to Center Items Horizontally and Vertically with Flexbox in CSS
Learn how to center elements horizontally and vertically with CSS Flexbox, including stacked rows, alignment rules, and common mistakes.
How to Center a div Horizontally in CSS
Learn how to horizontally center a fixed-width div in CSS using margin auto, with examples, mistakes, and practical layout tips.
How to Change Placeholder Text Color in CSS
Learn how to style HTML input placeholder text with CSS using ::placeholder and browser-specific selectors.
How to Change an Element's Class with JavaScript
Learn how to change, add, remove, and toggle HTML element classes with JavaScript using events like click.
How to Change the href Attribute with jQuery
Learn how to change a hyperlink's href attribute using jQuery with clear examples, common mistakes, and practical use cases.
How to Check If a DOM Element Is Visible in the Viewport in JavaScript
Learn how to detect whether a DOM element is visible in the current viewport using JavaScript, with examples and common pitfalls.
How to Check Whether an Element Has a Class in JavaScript
Learn how to check if a DOM element has a class in JavaScript using classList.contains(), with examples, mistakes, and practical use cases.
How to Clear an HTML Canvas for Redrawing in JavaScript
Learn how to clear an HTML canvas for redrawing in JavaScript using clearRect, resizing, and common redraw patterns.
How to Create Indentation in HTML Without Repeating
Learn why HTML ignores tab spacing, when works, and the correct CSS and semantic ways to create indentation in HTML.
How to Create a Checkbox With a Clickable Label in HTML
Learn how to create an HTML checkbox with a clickable label using the label element, for attribute, and accessible form patterns.
How to Create a Placeholder for a Select Box in HTML and CSS
Learn how to create a placeholder-like option for a select box using HTML, CSS, and JavaScript, with beginner-friendly examples.
How to Create a div Element in jQuery
Learn how to create a div element in jQuery, add content and attributes, and insert it into the page with clear examples.
How to Disable Browser Autocomplete on Form Inputs in HTML
Learn how browser autocomplete works in HTML forms, when `autocomplete="off"` helps, and the limits across major browsers.
How to Disable Textarea Resizing in CSS
Learn how to disable the resizable property of a textarea using CSS. See syntax, examples, common mistakes, and practical use cases.
How to Display Base64 Images in HTML
Learn how to display Base64 images in HTML using data URLs, with examples, common mistakes, and practical usage patterns.
How to Embed a PDF in HTML: iframe vs object vs embed
Learn the recommended ways to embed a PDF in HTML using iframe, object, and embed, with examples, fallbacks, and browser support tips.