0% found this document useful (0 votes)
16 views3 pages

HTML-CSS Questions

The document provides explanations for various HTML concepts, including the differences between strong and bold tags, multipart/form-data for file uploads, and the use of cellspacing and cellpadding in tables. It also covers the distinctions between HTML and XHTML, the merging of table rows/columns, and the functionalities of iframe and anchor tags. Additionally, it discusses layout creation with grid and flexbox, formatting tags, the limitations of using HTML in CSS, and the advancements in HTML5 compared to its predecessor.

Uploaded by

rootworld1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

HTML-CSS Questions

The document provides explanations for various HTML concepts, including the differences between strong and bold tags, multipart/form-data for file uploads, and the use of cellspacing and cellpadding in tables. It also covers the distinctions between HTML and XHTML, the merging of table rows/columns, and the functionalities of iframe and anchor tags. Additionally, it discusses layout creation with grid and flexbox, formatting tags, the limitations of using HTML in CSS, and the advancements in HTML5 compared to its predecessor.

Uploaded by

rootworld1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1) What is the difference between strong and bold tag?

2) What is multipart/form-data?
 Multipart/form-data is an encoding type used when submitting form data that includes files,
blobs, or binary data (like images, PDFs, etc.) from an HTML form to a server.

By default, forms use application/x-www-form-urlencoded, which URL-encodes all data


(good for simple text). But this doesn’t work well for binary data like file uploads.
That’s where multipart/form-data comes in:
It breaks the form data into multiple parts, each with its own content headers, allowing the
upload of files along with text fields.

<form action="/upload" method="POST" enctype="multipart/form-data">


<input type="text" name="username">
<input type="file" name="profilePic">
<button type="submit">Upload</button>
</form>

3) What is cellspacing and cellpadding?


 Space between table cells govern by cellspacing. It controls the gap between the borders of
adjacent cells.

<table cellspacing="10">
...
</table>

Space inside a cell (between border and content) govern by cellpadding(deprecated)

<table cellpadding="10">
...
</table>

4) What is the difference b/w html and xhtml?


5) How can you merge two or more rows/Columns?


 1. colspan – Merge Columns (Horizontally)

<table border="1">
<tr>
<th colspan="2">Name</th>
</tr>
<tr>
<td>First</td>
<td>Last</td>
</tr>
</table>
This merges the first row's 2 columns into one cell labeled “Name”

6) What is the iframe and anchor tag?


 <a> Tag – Anchor
Used to create hyperlinks.
Can open in the same tab, new tab, or a named frame.

Example:
<a href="https://example.com" target="_blank">Visit Example</a>

 target="_blank" → opens in new tab


 target="myFrame" → opens inside a named <iframe>

<iframe> Tag – Inline Frame


Used to embed an external webpage,video,map or document within your page.

Example:
<iframe src="https://example.com" width="600" height="400"></iframe>

 Shows example.com inside your page


 Users can scroll, click, interact inside the iframe

7) What is the difference b/w grid and flexbox creating multicolumn layout?
 Flexbox is used to create one dimension layout while by grid we can create two dimensional
layout, allows flexible row or column layouts.

Using flexbox->

<div style="display: flex; flex-wrap: wrap;">


<div style="flex: 1 0 30%;">Column 1</div>
<div style="flex: 1 0 30%;">Column 2</div>
</div>

This can adjust screen size easily.

Using Grid->

<div style="display: grid; grid-template-columns: 1fr 1fr;">


<div>Column 1</div>
<div>Column 2</div>
</div>

1fr 1fr creates two equal columns.

8) What are formatting tags? Give some examples?


 Formatting tags in HTML are elements used to apply specific text styles or emphasize certain
parts of the content without affecting the document’s structure. They help change the
appearance or meaning of text inline.
<b> => Makes text bold (stylistic)
<strong> => Indicates strong importance (usually bold)
<u> => Underlines text
<i> => Italicizes text (stylistic)

9) Can you use HTML inside CSS? If not, what is the alternative?
 No, you cannot use HTML inside CSS.
CSS is a stylesheet language used only to style HTML elements; it cannot contain or render
HTML markup.

Alternative:
Use CSS selectors to target HTML elements and apply styles.
For dynamic or conditional content, manipulate HTML with JavaScript or use
frameworks/libraries (React, Vue, etc.) to generate HTML dynamically.

10) Difference between HTML and HTML5?


 HTML is the standard markup language used to structure content on the web, whereas
HTML5 is its latest major version that introduced significant improvements in simplicity,
functionality, and semantics.
One of the key changes is the doctype declaration — older versions used long and complex
declarations, while HTML5 uses a simple <!DOCTYPE html>.
HTML5 introduced new semantic elements such as <article>, <section>, <nav>, <header>,
<footer>, and <aside> to give more meaning to content. It also added native multimedia
support through the <audio> and <video> tags, eliminating the need for third-party plugins
like Flash.
Form controls were enhanced with new input types such as email, date, range, and color,
improving user experience and validation.
Additionally, HTML5 brought in powerful APIs like Canvas for drawing, Web Storage for local
data storage, Geolocation for location tracking, and Web Workers for background
processing.
Overall, HTML5 is designed to be more semantic, mobile-friendly, and feature-rich while
maintaining backward compatibility with older HTML versions.

11) Purpose of <small> tag?


 The <small> tag is used to render text in a smaller font size than the surrounding text.
Semantically, it often represents fine print, disclaimers, side comments, or legal notices.

You might also like