HTML Concepts and Practice Questions
HTML Concepts and Practice Questions
The <marquee> tag is used to create scrolling text or images on a web page. It makes content move, either horizontally or vertically, across the viewer's screen. An example of its use is: <marquee>Scrolling text example</marquee>. Note that the use of <marquee> is deprecated in modern HTML standards, and CSS or JavaScript is recommended for such effects .
The default border attribute value for the <TABLE> tag in HTML is 1. This is important because it determines the initial appearance of table borders, providing a distinct visual separation of table cells which can be enhanced or suppressed according to design needs through CSS .
The RGB code for red in HTML is #ff0000. This is used in web design to apply a pure red color to any HTML element that accepts color styling, ensuring consistent color representation across different devices and browsers .
A typical HTML web page structure includes the document type declaration (<!DOCTYPE html>), the <html> tag as the root element, a <head> section containing metadata, styles, and scripts, and a <body> section where the visible content is placed. This setup ensures proper rendering by web browsers .
The <DL> tag is used to write definition lists in HTML. Its components include <DT> for the term and <DD> for the description or definition. This structure is useful for presenting glossaries or explanations where terms require further elaboration .
Advantages of HTML include its simplicity and ease of learning, being open and widely supported, and not requiring programming knowledge. However, its disadvantages involve its static nature, inability to create dynamic outputs or applications without using it alongside other technologies, and its outdated elements like the <font> tag, that are no longer standard .
<OL> and <UL> tags define ordered and unordered lists, respectively. <OL> presents items with a sequence (e.g., numbers or letters) indicating order, as in <ol><li>First</li><li>Second</li></ol>. In contrast, <UL> shows items with bullet points, as in <ul><li>Item</li><li>Another item</li></ul>, indicating no inherent priority or order .
The <SUB> tag is used to create subscript text, rendering it smaller and lowered compared to the baseline, commonly used in chemical formulas like H<sub>2</sub>O. The <SUP> tag creates superscript text, appearing smaller and raised, often used for exponents such as E=mc<sup>2</sup> .
The <EM> tag is used to define emphasized text, which typically renders as italicized text but is intended to denote emphasis and thus can change in future styling or devices. The <I> tag specifically sets the text in an italic style purely for stylistic reasons. This means <EM> is semantically distinct as it communicates meaning to assistive technologies and search engines, whereas <I> does not .
The <A> tag is the anchor element used to create hyperlinks in HTML. The HREF attribute within the <A> tag specifies the destination URL of the link. This functionality is crucial for web navigation, allowing users to move between web pages or sections easily .






