Class 12 Advanced Web Designing Q&A
Class 12 Advanced Web Designing Q&A
HTML offers two basic list types: unordered (<ul>) for bulleted lists and ordered (<ol>) for numbered lists. Bulleted lists use the <li> tag within the <ul> and can have different bullet styles with CSS. Numbered lists use <ol> with <li>, supporting different numeric styles such as decimal, roman, or alphabetic. These are essential for structuring information hierarchically on websites, where unordered lists are often used for simple item groupings and ordered lists for step-by-step instructions .
Universal selectors (*) apply styles to all elements in a document, offering simplicity for global styling but limited specificity. Class selectors (e.g., .className) apply styles to elements with a specific class attribute, promoting reusability and organization by allowing targeted styling of multiple elements without affecting others. Universal selectors are used for broad initial styles, while class selectors manage grouped styling for component-specific design .
HTML5 uses the <audio> tag to embed audio files, supporting fallback content within if the user's browser doesn't support the format. Attributes include 'src' for source file URLs, 'controls' for media controls, and 'autoplay', which start playback on load. Compatibility varies with formats like MP3, WAV, and OGG, with MP3 being universally supported across modern browsers. HTML5 provides built-in interface controls without plugins, improving accessibility but requires format awareness for full compatibility .
Efficient page rendering involves optimizing HTML, CSS, and JavaScript for speed. Strategies include minimizing DOM complexity, reducing CSS rule count, and using async or defer attributes for JavaScript to prevent blocking. Technological improvements involve leveraging Content Delivery Networks (CDNs) for faster content delivery, image optimization, server-side rendering, and best practices for caching. These actions enhance page load times, thereby improving UX and SEO .
JavaScript validation verifies user input before server submission, reducing errors and improving UX by providing immediate feedback. For usernames, a function checks for non-blank input, ensuring essential information is collected. For passwords, it enforces constraints like a minimum length (e.g., eight characters) for security. Functions typically utilize conditions to confirm compliance, alerting users to input errors .
The DOM hierarchy consists of objects that represent the structure of a document, including elements like document, elements, attributes, text, and more. At the top is the 'Document' object, which is the root node. It contains 'Element' nodes that represent HTML or XML tags, which can have 'Attribute' nodes for tag attributes and 'Text' nodes for content. This hierarchy allows for structured access and manipulation of web documents through scripting, enabling dynamic changes to content, style, and structure .
The <style> tag embeds CSS within the HTML <head>. It offers convenience for quick, small-scale styling but increases document size and complicates style management. External stylesheets centralize CSS, promoting file reusability across documents, and facilitate easier maintenance and separation of style from content, a best practice for larger projects. They improve page load times and SEO by optimizing structure and caching .
CSS offers flexibility, reusability, and separation of content and presentation by allowing designers to apply consistent styles across multiple pages from a single stylesheet. This separation improves maintainability and scalability of web design. Inline styles apply directly within HTML, offering simplicity but at the cost of cluttering HTML, reducing maintainability, and causing the same style to be repeated across different elements, complicating updates .
The <meta> tag provides metadata about an HTML document. It is crucial for setting the character set (e.g., UTF-8 for universal character encoding), defining keywords for search engine optimization, and providing descriptions that appear in search results or sharing previews. Although it doesn't alter content directly, it is essential for technical SEO, browser instructions, and ensuring the correct interpretation of page content .
HTML tables are defined using the <table> tag, with rows (<tr>) and cells (<td>). Key attributes include 'border' for outline visibility, 'cellpadding' and 'cellspacing' for spacing, and 'align' for text alignment. Properties like 'colspan' and 'rowspan' merge cells, affecting layout complexity and usability. Proper use enhances readability and data organization, while CSS supplements these by styling borders, background, and text .