Web Design Viva
Web Design Viva
What is the primary purpose of the <html> tag in Web Design, and how can you merge rows and
columns in a table?
Primary Purpose of the <html> Tag in Web Design:
The <html> tag is the root element of an HTML document. It defines the entire structure of a webpage and
contains two main sections:
<head>: Includes metadata, title, and links to stylesheets or scripts.
<body>: Contains the visible content of the webpage, such as text, images, and tables.
To merge rows and columns in an HTML table, we use the colspan and rowspan attributes inside the <td>
or <th> tags.
*Merging Columns: The colspan attribute is used to make a single cell span across multiple columns. For
example, if colspan="2", that cell will take the space of two columns.
*Merging Rows: The rowspan attribute is used to make a single cell extend across multiple rows. If
rowspan="2", that cell will take up the space of two rows.
These attributes help in structuring tables by combining cells
2.What tag is useful for add a image and how can you make an image function as a clickable hyperlink in
HTML?
* Tag for Adding an Image in HTML:
The <img> tag is used to add an image to a webpage. It requires the src attribute to specify the image
source (URL or file path) and the alt attribute for alternative text, which helps with accessibility.
*Making an Image a Clickable Hyperlink:
To make an image function as a clickable hyperlink, we wrap the <img> tag inside an <a> (anchor) tag. The
href attribute in the <a> tag specifies the destination URL.
This allows users to click on the image and be redirected to another webpage or resource.
3.What are the different types of input fields available in HTML forms, and how are they used?
Text (type="text") – Used for single-line text input, like names or usernames.
Textarea - Used for multi-line text input.
URL (type="url") – Ensures valid URL input.
Password (type="password") – Masks user input, used for entering passwords securely.
Email (type="email") – Ensures that only valid email addresses are entered.
Number (type="number") – Allows numerical input with optional min/max limits.
Radio (type="radio") – Lets users select only one option from a group.
Checkbox (type="checkbox") – Allows multiple selections from a list of options.
Date (type="date") – Provides a calendar for selecting a date.
File (type="file") – Lets users upload files.
Submit (type="submit") – A button to submit the form data to a server.
Button (type="button") – A customizable button for various actions.
Reset (type="reset") – Clears all form inputs to their default values.
Search (type="search") – Optimized for search input fields.
Range (type="range") – Provides a slider to select a numerical value within a range.
Color (type="color") – Opens a color picker for selecting colors.
Tel (type="tel") – Accepts phone numbers but does not enforce a format.
Time (type="time") – Allows users to select a time.
4. Define the purpose of the <table> tag in HTML, and what are the advantages of using it?
Purpose of the <table> Tag in HTML:
The <table> tag is used to organize and display data in a structured row-and-column format, making it easier
to read and compare information.
Advantages of Using <table>:
Structured Data Representation – Displays information in an organized way.
1. Easy Comparison – Helps in comparing numerical or textual data.
2. Customizable – Supports merging cells with colspan and rowspan.
3. Styled with CSS – Enhances appearance with colors, borders, and spacing.
4. Accessible – Screen readers can interpret well-structured tables.
5.What are the different types of lists in HTML, and how can text be formatted using HTML tags?
Types of Lists in HTML:
1. Ordered List (<ol>) – Displays items in a numbered sequence.
2. Unordered List (<ul>) – Displays items with bullet points.
3. Definition List (<dl>) – Used for terms and their definitions with <dt> (term) and <dd> (definition).
Text Formatting in HTML:
1. Bold (<b>, <strong>) – Highlights text in bold.
2. Italic (<i>, <em>) – Emphasizes text in italics.
3. Underline (<u>) – Underlines text.
4. Strikethrough (<s>, <del>) – Shows deleted or incorrect text.
5. Superscript (<sup>) – Displays text above the baseline (e.g., exponents).
6. Subscript (<sub>) – Displays text below the baseline (e.g., chemical formulas).
7. Break (<br>) – Adds a line break.
8. Paragraph (<p>) – Structures text into paragraphs.
9. Preformatted (<pre>) – Preserves whitespace and formatting.