OE Web Design Unit 2 QB Solved
OE Web Design Unit 2 QB Solved
UNIT-2
<html>
<head>
<title>
</title>
</head>
<body>
</body>
</html>
Ex:<body>, <title>
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
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.
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.
Small:- It displays the text in a font slightly smaller than the regular font.
Strong:-The <strong> HTML element indicates that its contents have strong importance
seriousness or urgency. Browsers typically render the contents in bold type.
<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
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
The basic structure of an HTML document includes tags, which surround content and apply
meaning to it.
<html>
<head>
<title>
</title>
</head>
<body>
</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
</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
Next Open TextEdit (Mac) Open Finder > Applications > TextEdit..
Step 2: Write some HTML. Write or copy the following HTML code into Notepad…
Dept of Computer Science Dr. B B Hegde First Grade College Kundapura Page No: 5
Harish Kanchan BA/BCOM/BSC/BBA/BSW 1st Year
Tag Meaning
Tag Description
EM Emphasized text
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.
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.
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>
• authorship information
• copyright information
• contact information
• sitemap
• back to top links
• related documents
Example
<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
• 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.
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.
<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)
<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
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.
<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
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:
• 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.
• 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:
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