Unit Previous 3 Years Solution Web Tech
Unit Previous 3 Years Solution Web Tech
Q1.22:
Create a css rule that makes all the text 2 times larger than the base font of the
system. Mention can you integrate css on a web page
Ans:
To create a CSS rule that makes all the text 2 times larger than the base font size of the
system, you can use the font-size property with a relative unit like em.
body {
font-size: 2em;
This rule will apply to all text within the <body> tag, making it 2 times larger than the
base font size of the browser or system.
Integrating CSS on a Web PageYou can integrate CSS into a web page in several
ways:
Inline CSS: You can use the style attribute directly within HTML tags.<p style="font-size:
2em;">This is a paragraph with inline CSS.</p>Internal CSS: You can include CSS rules
within a <style> tag in the <head> section of your HTML document.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
font-size: 2em;
</style>
<title>Document</title>
</head>
<body>
</body>
</html>
External CSS: You can link to an external CSS file from within the <head> section of
your HTML document.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
font-size: 2em;
Each method has its use cases. Inline CSS is useful for quick, one-off styles. Internal
CSS is good for single-page applications. External CSS is best for applying consistent
styles across multiple pages.
Q2.22
Create an HTML code to create a web page that contains the user registration form
with following details user name, user date of birth, user address, user gender, user
email id, user mobile number.
Ans:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
</div>
<div>
</div>
<div>
<label for="address">Address:</label>
</div>
<div>
<label>Gender:</label>
<label for="male">Male</label>
<label for="female">Female</label>
</div>
<div>
</div>
<div>
</div>
<div>
<button type="submit">Register</button>
</div>
</form>
</body>
</html>
OUTPUT:
Date of Birth:
Address:
Gender: Male Female Other
Email ID:
Mobile Number:
Register
Q3.22 ) Design a XML DTD for self describing weather report having
following details: Date, location, temperature range (Location describes
city, state and its country. Country code is unique and not left blank.
Temperature range describes high and low temp. In Fahrenheit or
Celsius).
Ans:
Here's an example of an XML DTD (Document Type Definition) for a self-
describing weather report with the specified details:
<!DOCTYPE weatherReport [
<!ELEMENT weatherReport (date, location, temperatureRange)>
]>
Example XML Document Conforming to the DTD
<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE weatherReport [
<!ELEMENT weatherReport (date, location, temperatureRange)>
<!ATTLIST countryCode
Unique CDATA #REQUIRED>
]>
<weatherReport>
<date>2024-06-18</date>
<location>
<city>San Francisco</city>
<state>California</state>
<country>
<countryCode unique=”US”>US</countryCode>
<countryName>United States</countryName>
</country>
</location>
<temperatureRange>
<high>75</high>
<low>55</low>
<unit>Fahrenheit</unit>
</temperatureRange>
</weatherReport>
Output:
2024-06-18
Q1,23:
Data Interchange:
XML serves as a standard format for exchanging data between different
systems and applications, ensuring that data can be shared regardless of the
underlying platform.
Content Management Systems: XML is used to store and transport data in
content management systems (CMS), enabling the separation of content from
presentation.
In various industries, XML is used for EDI to facilitate the automated exchange
of business information, such as invoices and purchase orders.
Syntax: Written in XML, making it more expressive and allowing for greater
validation capabilities.
Tools and Support: Widely supported by modern XML parsers and editors,
offering advanced validation and editing features.
Data Types: Limited support for data types, primarily focusing on the
structure of the document rather than the type of data.
Namespace Support: Lacks robust support for XML namespaces, making it
less suitable for documents that require namespace qualification.
Syntax: Uses a unique syntax different from XML, which can be less intuitive
for users familiar with XML.
Tools and Support: Although still supported, DTDs are less favored in modern
applications due to their limitations and the richer capabilities of XSD.
Q2.23
Describe frames in HTML. Write markup to create a web page that
contains three vertical columns, having background color as red,blue,
green respectively.
Ans:
Frames in HTML allow the division of a web browser window into multiple
sections, each capable of loading a separate HTML document.
To create a web page with three vertical columns, each having different
background colors (red, blue, and green), you can use HTML and CSS.
Below is an example of the markup and styles needed to achieve this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
display: flex;
height: 100vh; /* Makes the columns fill the full height of the
viewport */
margin: 0;
.column {
flex: 1;
display: flex;
font-size: 2em;
}
.red {
background-color: red;
}
.blue {
background-color: blue;
}
.green {
background-color: green;
</style>
</head>
<body>
</body>
</html>
Output:
Q3,23:
<!ELEMENT to (#PCDATA)>
<from>sender@example.com</from>
<to>receiver@example.com</to>
<subject>Meeting Reminder</subject>
<date>2024-06-18</date>
</header>
<body>
</body>
</email>
Output:
sender@example.com receiver@example.com Meeting Reminder 2024-06-18Dear
Team, This is a reminder for our meeting scheduled at 10 AM tomorrow.
Q1.2019:
Describe the role and importance of CSS in web designing. Also
Differentiate Class and Id in CSS.
Ans:
Role and Importance of CSS in Web Designing
Cascading Style Sheets (CSS) play a crucial role in web design by
controlling the visual presentation of web pages. Here are some key
aspects:
This separation makes the HTML code cleaner and more semantic,
focusing on the structure and meaning of the content.
2.Consistency and Reusability:
By defining styles in a CSS file, you can apply the same styles across
multiple pages of a website, ensuring a consistent look and feel.
This approach also makes it easier to maintain and update the design, as
changes in the CSS file will automatically reflect across all pages.
3.Enhanced Design Flexibility:
4.Improved Performance:
By separating the styling from the HTML, CSS files can be cached by the
browser.
This caching reduces the amount of data transferred and speeds up page
load times, improving the overall performance and user experience.
5.Accessibility:
CSS can be used to improve the accessibility of web pages. For instance,
CSS can be used to create responsive designs that adapt to different
screen readers, making the content more accessible to users with
disabilities.
Class Selector:
Syntax:
.classnameUsage:
Example:
background-color: yellow;
}
Purpose:
Classes are typically used for styling elements that share common
properties, such as buttons, headings, or any repeated visual components.
Id Selector:
Syntax: #idnameUsage:
Purpose: Ids are used for unique elements that need specific styling or for
targeting individual elements in JavaScript.
Q2.2019
“Document Type Definition (DTD) in XML is necessary”, justify the
statement With suitable example. Under which conditions which DTD
is more preferable.
Ans:
4.Enforcement of Rules:
Constraints: Enforces rules regarding the presence, order, and data type
of elements and attributes, ensuring that the XML document is well-formed
and valid.
Example of a DTD and XML Document
<person>
<name>John Doe</name>
<age>30</age>
<email>john.doe@example.com</email>
</person>
Internal DTD
*No Need for Reuse:The DTD is specific to a single document and does
not need to be reused across multiple documents.
*Immediate Validation:
Example:
<!DOCTYPE person [
<!ELEMENT person (name, age, email)>
<person>
<name>John Doe</name>
<age>30</age>
<email>john.doe@example.com</email>
</person>
2.External DTD
Definition:
An external DTD is defined in a separate file and referenced by the XML
document.
Preferred When:
XML Document:
<person>
<name>John Doe</name>
<age>30</age>
<email>john.doe@example.com</email>
</person>
Summary
1.Internal DTD is preferable for small, self-contained documents, quick
development, and situations where the DTD does not need to be reused.
Q3.2019
ans:
<!DOCTYPE html>
<head>
<title>Heade.html</title>
</head>
<FRAMESET COLS="*,*">
<FRAME SRC="Menu.html">
<FRAME SRC="Output.html">
</FRAMESET>
<NOFRAMES>Your browser does not support frames.</NOFRAMES>
</html>