0% found this document useful (0 votes)
31 views14 pages

OE Web Design Unit 2 QB Solved

Web designing
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)
31 views14 pages

OE Web Design Unit 2 QB Solved

Web designing
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/ 14

Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

UNIT-2

Two marks questions

1. Write the basic structure of an HTML document.

<html>

<head>

<title>

TITLE OF WEB PAGE

</title>

</head>

<body>

CONTENTS OF WEB PAGE

</body>

</html>

2.What are the two categories of HTML tags? Give example.

The two categories of HTML tags are


1.empty tag:- It represents a formatting option like line break, paragraph setting.
Ex: <p>, <br>, <li>

2.container tag:- It includes a section of text, that specifies a formatting


construction for the selected text. It always includes a start tag and end tag.

Ex:<body>, <title>

3. What is the purpose of DOCTYPE element in HTML document?

The HTML document type declaration, also known as DOCTYPE, is the first line of code
required in every HTML or XHTML document. The DOCTYPE declaration is an instruction to
the web browser about what version of HTML the page is written in. This ensures that the
web page is parsed the same way by different web browsers.

4. What is Root elements? Name the Root element used in HTML document .

Each XML document has exactly one single root element. It encloses all the other elements
and is, therefore, the sole parent element to all the other elements. ROOT elements are also
called document elements.

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 1
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

5. Write any 4 text formatting elements.

• <b> - Bold text


• <strong> - Important text
• <i> - Italic text
• <em> - Emphasized text
• <mark> - Marked text
• <small> - Smaller text

6. What is the purpose of MARK element?

HTML element represents text which is marked or highlighted for reference or notation
purposes, due to the marked passage’s relevance or importance in the enclosing context.

7. What is the use of CODE element?

The HTML <code> element is used to define a piece of computer code. The content inside is
displayed in the browser’s default monospace font.

8. What is the purpose of Header and footer element?

Headers and footers generally contain additional information such as page


numbers, dates, an author's name, and footnotes, which can help keep longer documents
organized and make them easier to read. Text entered in the header or footer will appear
on each page of the document.

9. Why STRONG and SMALL elements are used?

Small:- It displays the text in a font slightly smaller than the regular font.

The tag is <small>second puc</small>

Strong:-The <strong> HTML element indicates that its contents have strong importance
seriousness or urgency. Browsers typically render the contents in bold type.

10. Differentiate <WBR> and <BR>

<WBR> :-

➢ The <wbr> tag used to specify a line break opportunity within an HTML
document.
➢ Without wbr tag it is very difficult to read a long single word or a sentence.

<BR>:-

➢ The HTML <br> element defines a line break. The <br> tag is an empty tag, which
means that it has no end tag.
➢ The "br" tag inserts a single line break into the web document.

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 2
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
11. Name the tags used to display Lists with their purpose.
HTML lists allow web developers to group a set of related items in lists.
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
The list items will be marked with bullets (small black circles) by default:
Example
<ul>
<li>Pranam</li>
<li>Mahesh</li>
<li>Shreekanth</li>
</ul>
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
The list items will be marked with numbers by default:
Example
<ol>
<li>Pavithra</li>
<li>Wilma</li>
<li>Rahmi</li>
</ol>
Definition lists
A definition list is a list of terms, with a description of each term. Definition list values
appear within <dl> and </dl> tag.
It consists of two parts: Definition Term <DT> and the Definition Description <DD>
Example:-
<dl>
<dt> Jayalaxmi
<dd> Harish Kanchan
<dt> Vijayashree
<dd> Megha

12. Differentiate <BR> and <P>


<BR>:-
Dropping the end tag can produce unexpected results or errors. The HTML <br> element
defines a line break. The <br> tag is an empty tag, which means that it has no end tag. The
"br" tag inserts a single line break into the web document.
<br> stands for "Line Break".
If you were to insert that in your HTML, it would be like typing the Enter or Return key on
your keyboard. This comes in handy a lot, and the avid web designer should use it
frequently.
<P>:-
The "p" tag defines a paragraph, but the paragraph is typically automatically given space
before and after by the browser.
< p >on the other hand, stands for "Paragraph."
" It is used to organize your HTML, so that it will be easy to edit it later on. Typing < p >
says that you are starting a new paragraph, and typing < /p > says that you are ending
one.

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 3
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
Long Answer Questions

1. Explain the structure of HTML document.

Structure of HTML Program

The basic structure of an HTML document includes tags, which surround content and apply
meaning to it.

<html>

<head>

<title>

TITLE OF WEB PAGE

</title>

</head>

<body>

CONTENTS OF WEB PAGE

</body>

</html>

• HTML document begins and ends with HTML tag i.e. <HTML> </HTML> Here <HTML>
indicates the browser that it is a HTML document and </HTML> tells the browser that HTML
document is completed.
• Header Tag i.e. <HEAD></HEAD> Header Tag does not contain any text, it only contains
the Title Tag in it.
• Title tag i.e. <TITLE></TITLE> Anything written between this tag is not displayed on the
screen but it is used to identify the Webpage.
• Body tag i.e. <BODY></BODY> This is the main part of HTML document. The content
which is to be displayed on screen as webpage should be written here. Body Tag contains the
text as well as various tags but only the text will be displayed on Webpage.

Example:

<html>

<head>

<title> KANCHAN</title>

</head>

<body>

Hi Friends

This is my first web page

</body> </html>

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 4
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

2. Write the steps used to create and save an HTML document.


Step 1: Open Notepad (PC) Windows 8 or later…
Start > Programs > Accessories > Notepad

Next Open TextEdit (Mac) Open Finder > Applications > TextEdit..

Step 2: Write some HTML. Write or copy the following HTML code into Notepad…

Step 3: Save the HTML Page.

Step 4: Select the location to Save the file on your computer…

Step 5: Give file name extension as .html

For Example : Sona..html

Step 6: View the HTML page in your Browser.

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 5
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

3. Explain formatting HTML document with physical style.

Tag Meaning

<b> Bold contents

<big> Increased font size

<blink> (obsolete) Alternating fore- and background colors

<i> Italic contents

<small> Decreased font size

<s>, <strike> (deprecated) Strikethrough text

<sub> Subscripted text

<sup> Superscripted text

<tt> Teletypewriter style

<u> (deprecated) Underlined contents

4. Explain formatting HTML document with logical style.

Tag Description

ABBR Displays the abbreviation on the Web page

CODE Refers to the program code

SAMP Displays the sample program output on the Web page

KBD Refers to the keyboard keys

EM Emphasized text

STRONG Emphasized text by increasing boldness

DFN Displays new terms on the Web page

Q Displays the short quotations on the Web page

BLOCKQUOTE Displays the long quotations on the Web page

INS Displays the inserted text

DEL Displays the deleted text


Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 6
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
VAR Represent a variable

BDO Changes the direction of text

5. Explain the use of TITLE and BASE element.

TITLE: Avoid one- or two-word titles. Use a descriptive phrase, or a term-definition pairing
for glossary or reference-style pages.
Search engines typically display about the first 55–60 characters of a page title. Text
beyond that may be lost, so try not to have titles longer than that. If you must use a longer
title, make sure the important parts come earlier and that nothing critical is in the part of
the title that is likely to be dropped.
Don't use "keyword blobs." If your title is just a list of words, algorithms often reduce your
page's position in the search results.
Try to make sure your titles are as unique as possible within your own site. Duplicate—or
near-duplicate—titles can contribute to inaccurate search results.
BASE: If multiple <base>elements are used, only the first href and first target are obeyed —
all others are ignored.

Links pointing to a fragment in the document — e.g. <a href=”#some-id”>— are resolved
with the<base>, triggering an HTTP request to the base URL with the fragment attached.

6. Explain SECTION and NAV elements.


Section: This tag represents a generic document or application section. It can be used
together with h1-h6 to indicate the document structure.
This element is used for grouping related content within the body of the web page. This
element can be nested. This element represents a generic chunk of content within a
web page. It represents a thematic grouping of web page content typically with a
heading.

NAV: This tag represents a section of the document intended for navigation. This
element, represents a section of a page that links to other web pages or to parts of web
page within the same page. It is a section of web page content with navigation links.

7. Write a note on Header, Footer and address elements.


Header: The <header> element represents a container for introductory content or a set
of navigational links.

A <header> element typically contains:

• one or more heading elements (<h1> - <h6>)


• logo or icon

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 7
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
• authorship information

Example

A page header:

<header>
<h1>Main page heading here</h1>
<p>Posted by John Doe</p>
</header>

Footer: The <footer> tag defines a footer for a document or section.

A <footer> element typically contains:

• authorship information
• copyright information
• contact information
• sitemap
• back to top links
• related documents

You can have several <footer> elements in one document.

Example

A footer section in a document:

<footer>
<p>Author: Hege Refsnes</p>
<p><a href="mailto:[email protected]">[email protected]</a></p>
</footer>

Address: The <address> tag defines the contact information for the author/owner of a
document or an article.

The contact information can be an email address, URL, physical address, phone number,
social media handle, etc.

The text in the <address> element usually renders in italic, and browsers will always add a
line break before and after the <address> element.

Example
<address>
Written by <a href="[email protected]">Harish Kanchan</a>.<br>
Visit us at: <br>
bbhegdecollege.com<br>
Dr. B.B. Hegde First Grade College Kudapura<br>
</address>

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 8
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

8. What are the data types available in HTML? Explain.

There are the following four basic data types in HTML :

• Character data type - Stores single alphanumeric text, which includes letters,
numbers, symbols, space, or punctuations.
• Text data type - Stores a string with maximum length of 2,147,483,647 printable
characters.
• Name date type - Refers to a name given to any particular datun (singular form of
data), function, or unit of a program in a programming language
• Number data type - Refers to the data type that can store a number in the range of
1E-323 to 1.79E+308 (positive or negative) with an accuracy of about 15 digits.
Arithmetical operations can be performed with number data types.

9. Explain the various elements used to format the texts in HTML.

Element Description
name

<b> This is a physical tag, which is used to bold the text written between it.

<strong> This is a logical tag, which tells the browser that the text is important.

<i> This is a physical tag which is used to make text italic.

<em> This is a logical tag which is used to display content in italic.

<mark> This tag is used to highlight text.

<u> This tag is used to underline text written between it.

<tt> This tag is used to appear a text in teletype. (not supported in HTML5)

<strike> This tag is used to draw a strikethrough on a section of text. (Not supported
in HTML5)

<sup> It displays the content slightly above the normal line.

<sub> It displays the content slightly below the normal line.

<del> This tag is used to display the deleted content.

<ins> This tag displays the content which is added

<big> This tag is used to increase the font size by one conventional unit.

<small> This tag is used to decrease the font size by one unit from base font size.

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 9
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

10.How do you prepare preformatted text? Give Example.

In HTML, you can prepare preformatted text using the <pre> element. This element preserves both spaces and line
breaks within the text, displaying it exactly as it appears in the HTML code. Here's how you can use the <pre>

<html>
<head>
<title>Kanchan</title>
</head>
<body>

<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>

</body>

</html>In the example above, any extra spaces between words and line breaks are maintained in the rendered
output. Additionally.

Using the <pre> element is particularly useful when displaying code predefined formate.

11. Explain DIV and SPAN elements.

<DIV>

The HTML <div> tag is used for defining a section of your document. With the div tag, you
can group large sections of HTML elements together and format them with CSS.

Example

<html>

<head>

<title>Kanchan</title>
Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 10
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
</head>
<body>
<div id=”myDiv” name=”myDiv” title=”Example Div Element” style=”font-family: Helvetica;
font-stze:12pt; border:1px solid black;”>
<div id=”subDiv1” name=”subDiv1” title=”Subdivision Div Element” style=”color: #FF0000;
border: 1px dotted black;”>
<h5>Section 1</h5>
<p>This paragraph 1 would be your content paragraph..</p>
<p>You can Write Content article here.</p>
</div>
<br />
<div id=”subDiv2” name=”subDiv2” title=”Subdivision Div Element” style=”color: #FF00FF;
border: 1px dashed black;”>
<h5>Section 2</h5>
<p>This paragraph 2 would be your content paragraph..</p>
<p>Here’s another content article right here.</p>
</div>
</div>
</body>
</html>

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 11
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
12. How Lists are displayed in HTML documents? Explain.

Lists:- It is used to display a collection of items in a particular form. Three types of lists are available
in html. They are unnumbered, numbered, and definition lists.

Unordered lists
Start with the opening tag <ul>, enter the list item tag <li>, no closing </li> is needed, end the
entire list with a closing list </ul> tag
Example:-
<p><b> My Favorite Actors are</b><p>
<ul type="circle">
<li> Mammuti
<li>Sudeep

<li>Salman Khan
<li> Vijay
</ul>
The bullet type can be changed by identifying the required type in the type attribute. The normal
types are discs, square, circle.
Ordered lists
This list is similar to ordered list except that it uses <ol> instead of <ul>. This is also known as
ordered list.
Example:-
<p><b> My Favorite Actress are</b><p>
<OL type="A">
<li>Anushka shetty
<li>Aishwarya Rai
<li>Rakshitha
<li>Karina Kapoor
</OL>
Definition lists
A definition list is a list of terms, with a description of each term. Definition list values appear
within <dl> and </dl> tag.
It consists of two parts: Definition Term <DT> and the Definition Description <DD>
Example:-
<p><b> Components of Computer </b></p>
<dl>
<dt> Keyboard
<dd> It is an input device
<dt> Printer
<dd> It is an output device
</dl> </body></html>

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 12
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year

13. Explain basic HTML data types.

HTML (Hypertext Markup Language) primarily deals with the structure and presentation of content on
the web. It doesn't have data types in the traditional sense like programming languages, but it does
have elements that represent different types of content. Here are some basic HTML data types
represented by their corresponding HTML elements:

1. Text: Text data is represented using the <p> (paragraph), <span>, <div>, and <h1> to <h6>
(headings) elements primarily. These elements are used to display text content on a webpage.

2. Links: Links are represented using the <a> (anchor) element. They allow users to navigate
between different web pages or resources.

3. Images: Image data is represented using the <img> (image) element. It allows the inclusion of
images within a webpage.

4. Lists: Lists can be represented using <ul> (unordered list) and <ol> (ordered list) elements.
Within these elements, list items are represented using <li> (list item) elements.

5. Tables: Tabular data is represented using the <table> element, which contains rows
represented by <tr> (table row) elements and cells represented by <td> (table data/cell)
elements.

6. Forms and Inputs: Forms allow users to input data and interact with a webpage. Various input
types such as text input, checkboxes, radio buttons, and dropdown menus are represented
using elements like <input>, <textarea>, <select>, <button>, etc.

7. Metadata: Metadata provides information about the HTML document itself. This includes
elements like <title>, <meta>, <link>, <style>, and <script>, which define the title, character
encoding, stylesheets, scripts, and other meta-information related to the document.

14. Explain the data types defined by the RFC and IANA Documentation.

RFC (Request for Comments) documents and IANA (Internet Assigned Numbers Authority) documentation
primarily define data types and standards for communication protocols and internet-related services. Here are
some key data types defined by RFC and IANA documentation:

1. Internet Protocol (IP) Addresses:

• IPv4 Addresses: Defined in RFC 791, IPv4 addresses are 32-bit numerical addresses written in
dotted-decimal notation (e.g., 192.168.1.1).
• IPv6 Addresses: Defined in RFC 2460, IPv6 addresses are 128-bit hexadecimal addresses
represented in colon-separated notation (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

2. Domain Names:

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 13
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
• Domain Name System (DNS): Defined in various RFCs, DNS is a hierarchical distributed
naming system for computers, services, or any resource connected to the Internet. It translates
domain names to IP addresses and vice versa.
• Top-Level Domains (TLDs): IANA maintains a list of TLDs and their associated registries.
Examples include .com, .org, .net, and country code TLDs like .uk, .de, .jp, etc.

3. Uniform Resource Identifiers (URIs):

• Uniform Resource Locator (URL): Defined in RFC 3986, a URL is a specific type of URI that
specifies the location of a resource on the internet, typically starting with a protocol identifier
(e.g., http://example.com/resource).
• Uniform Resource Name (URN): URNs are unique identifiers for resources but do not specify
their location. URNs are defined in RFC 8141.

4. Media Types:

• MIME Types: Multipurpose Internet Mail Extensions (MIME) types are standardized by IANA
and define the format of files or content types transmitted over the internet. MIME types are
used in HTTP headers to indicate the type of content being transmitted.

5. Internet Protocols:

• Transmission Control Protocol (TCP): Defined in RFC 793, TCP is a connection-oriented


protocol providing reliable, ordered, and error-checked delivery of data packets over IP
networks.
• User Datagram Protocol (UDP): Defined in RFC 768, UDP is a connectionless protocol that
provides a simple interface between application programs and the internet's IP protocol.

6. Encoding Standards:

• Character Encoding: Standards like ASCII, UTF-8, UTF-16, etc., define how characters are
represented as binary data. Unicode standards are maintained by the Unicode Consortium,
while UTF encoding schemes are defined in RFC 3629.

7. Security Protocols:

• Transport Layer Security (TLS): TLS protocols are defined in various RFCs, providing secure
communication over a computer network. They ensure data privacy and integrity between
communicating applications.

• Secure Sockets Layer (SSL): SSL, the predecessor of TLS, has been deprecated due to security
vulnerabilities but is still referenced in some RFCs.

Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 14

You might also like