0% found this document useful (0 votes)
32 views

HTML

HTML is a markup language used to define the structure and layout of web pages. It focuses on displaying content, while XML focuses on transporting and storing data. Some key differences are that HTML elements are not case-sensitive, uses predefined tags, and does not require closing tags, while XML is case-sensitive, allows custom tags, and requires closing tags.

Uploaded by

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

HTML

HTML is a markup language used to define the structure and layout of web pages. It focuses on displaying content, while XML focuses on transporting and storing data. Some key differences are that HTML elements are not case-sensitive, uses predefined tags, and does not require closing tags, while XML is case-sensitive, allows custom tags, and requires closing tags.

Uploaded by

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

Q2. Diffentiate between html and xml.

HTML XML

1) HTML is used to display XML is a software and


data and focuses on how hardware independent tool
data looks. used to transport and
store data. It focuses on
what data is.

2) HTML is a markup XML provides a framework


language itself. to define markup
languages.

3) HTML is not case sensitive. XML is case sensitive.

4) HTML is a presentation XML is neither a


language. presentation language nor a
programming language.

5) HTML has its own You can define tags


predefined tags. according to your need.

6) In HTML, it is not necessary XML makes it mandatory


to use a closing tag. to use a closing tag.

7) HTML is static because it is XML is dynamic because it


used to display data. is used to transport data.

8) HTML does not preserve XML preserve


whitespaces. whitespaces.

Q3. Explain HTML tags and their attributes: (i) List (1) Table

(i) List:

HTML provides several tags for creating lists, the most common being <ul>, <ol>, and <li>.
<ul> (Unordered List): This tag is used to create an unordered or bulleted list. It contains a list of items,
which are typically marked with bullet points.

Attributes:

type: Specifies the type of bullet point (disc, circle, or square).

id: Provides a unique identifier for the list.

class: Assigns a class for styling with CSS.

<ol> (Ordered List): This tag is used to create an ordered or numbered list. It contains a list of items that
are automatically numbered.

Attributes:

type: Specifies the type of numbering (1, A, a, I, or i).

start: Specifies the starting number for the list.

id: Provides a unique identifier for the list.

class: Assigns a class for styling with CSS.

<li> (List Item): This tag is used to define individual items within a list, whether it's an ordered or
unordered list.

Attributes:

value: For ordered lists, specifies the value of the list item.

id: Provides a unique identifier for the list item.

class: Assigns a class for styling with CSS.

(ii) Table:

HTML uses the <table> element to create tables, and several related elements to structure and style the
tables. Commonly used related elements include <tr>, <th>, and <td>.

<table>: This tag is used to define the table itself. It contains rows and columns that structure the data.

Attributes:
border: Specifies the width of the table border.

width: Sets the width of the table.

cellspacing: Specifies the space between table cells.

cellpadding: Sets the space between cell content and cell borders.

id: Provides a unique identifier for the table.

class: Assigns a class for styling with CSS.

<tr> (Table Row): This tag defines a row within the table.

Attributes:

id: Provides a unique identifier for the row.

class: Assigns a class for styling with CSS.

<th> (Table Header Cell): This tag defines a header cell within a table. Header cells are typically used for
column or row headings.

Attributes:

colspan: Specifies the number of columns a header cell should span.

rowspan: Specifies the number of rows a header cell should span.

id: Provides a unique identifier for the header cell.

class: Assigns a class for styling with CSS.

<td> (Table Data Cell): This tag defines a standard data cell within the table.

Attributes:

colspan: Specifies the number of columns a data cell should span.

rowspan: Specifies the number of rows a data cell should span.

id: Provides a unique identifier for the data cell.

class: Assigns a class for styling with CSS.

These are the fundamental HTML tags and their attributes used for creating lists and tables in web
pages. Attributes allow you to customize the behavior and appearance of these elements.
Q4. create an HTML code to create the user registeration form with following from with
following details username, uses DOB, address, sendes, email id, cser mobile number.

<html>

<head>

<title>User Registration Form</title>

</head>

<body>

<h1>User Registration Form</h1>

<form action="submit_registration.php" method="post">

<label for="username">Username:</label>

<input type="text" id="username" name="username" required><br><br>

<label for="dob">Date of Birth:</label>

<input type="date" id="dob" name="dob" required><br><br>

<label for="address">Address:</label>

<input type="text" id="address" name="address" required><br><br>

<label for="gender">Gender:</label>

<input type="radio" id="male" name="gender" value="male">Male

<input type="radio" id="female" name="gender" value="female">Female

<input type="radio" id="other" name="gender" value="other">Other<br><br>

<label for="email">Email ID:</label>

<input type="email" id="email" name="email" required><br><br>

<label for="mobile">User Mobile Number:</label>

<input type="tel" id="mobile" name="mobile" required><br><br>


<input type="submit" value="Register">

</form>

</body>

</html>

OUTPUT:-

You might also like