0% found this document useful (0 votes)
14 views11 pages

HTML 1

The document explains various HTML formatting tags like <b>, <strong>, <mark>, <u>, <del>, and <small> with examples. It also explains features of HTML like being user friendly, supporting media, being platform independent and case insensitive. Additionally, it covers creating links with <a> tag, image maps, <img> tag attributes, stylesheets, HTML lists, tables, tags in head section, checkboxes, forms, and while loops in JavaScript with examples.

Uploaded by

ashadesai592020
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)
14 views11 pages

HTML 1

The document explains various HTML formatting tags like <b>, <strong>, <mark>, <u>, <del>, and <small> with examples. It also explains features of HTML like being user friendly, supporting media, being platform independent and case insensitive. Additionally, it covers creating links with <a> tag, image maps, <img> tag attributes, stylesheets, HTML lists, tables, tags in head section, checkboxes, forms, and while loops in JavaScript with examples.

Uploaded by

ashadesai592020
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/ 11

1.Explain any five text formatting tags in html.

Answer: - HTML Formatting is a process of formatting text for better look and feel. HTML
provides us ability to format text without using CSS. There are many formatting tags in
HTML.

a) Bold text(<b> and <strong>)

The HTML <b> element defines bold text, without any extra importance .

The HTML <strong> element defines text with strong importance. The content inside is
typically displayed in bold.

Example
<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>
<p><b>This text is bold.</b></p>
<p><strong>This text is important!</strong></p>
</body>
</html>

Output:-This text is normal.


This text is bold.
This text is important!

b) HTML Marked Formatting

If you want to mark or highlight a text, you should write the content within
<mark>.........</mark>.

Example:-

<!DOCTYPE>

<html>

<body>

<h2> I want to put a <mark> Mark</mark> on your face</h2>

</body>
</html>

Output:-

I want to put a Mark on your face

c) Underlined Text

If you write anything within <u>.........</u> element, is shown in underlined text .


Example:-

<!DOCTYPE>

<html>

<body>

<p> <u>Write Your First Paragraph in underlined text.</u></p>

</body>

</html>

Output:- Write Your First Paragraph in underlined text.

d) Deleted Text

Anything that puts within <del>..........</del> is displayed as deleted text.

Example:-

<!DOCTYPE>

<html>

<body>

<p>Hello <del>Delete your first paragraph.</del></p>

</body>

</html>

Output:-

Hello
[e)] Small ElementDelete your first paragraph.

The HTML <small> element defines smaller text

Example:-

<html>

<body>

<p><small>This is a paragraph</small></p>

</body>

</html>

Output:- This is a paragraph

2) Explain the features of HTML.

Answer:- Features of html

User friendly:- HTML is a user friendly and simple language. Programmers are build a
structure easily with the help of html tag.

Media Support:- We can easily add videos ,audios ,and pictures to our web pages with the
help of html tag. Tags like <video>,<audio>,<figure> and <img> can be used to display
media.

Platform Independent:- HTML is not platform dependent, as web pages can be displayed on
any os like macOS, Windows etc using a browser.

Case Insensitive:- One of the most important features is that it is case insensitive. So we
cannot make mistakes with tags by writing them in uppercase or lowercase.

Game Development:- HTML can be used to build simple 2D and 3D games.

New Semantic Elements:- These are like <header>, <footer> ,and <section>.

Geolocation:- Now visitors can choose to share their physical location with your web
applications.

Drag and Drop:- Drag and Drop the items from one location to another location on a the same
webpages .

Web Socket:- A next-generation bidirectional communication technology for web


applications.
3) How to create links in HTML? Explain its tags with an example.

Answer:- A link is specified using HTML tag <a>. This tag is called anchor tag and
anything between the opening <a> tag and the closing </a> tag becomes part of the
link and a user can click that part to reach to the linked document.

Syntax:-

<a href =”url”>text link </a.

Syntax Explanation:
href : The href attribute is used to specify the destination address
of the link used. "href" stands for Hypertext reference.
Text link : The text link is the visible part of the link.
It is what the viewer clicks on.

Example:-

<!DOCTYPE html>

<html>

<h3>Example Of Adding a link</h3>

<body>

<p>Click on the following link</p>

<a href="https://www.geeksforgeeks.org">GeeksforGeeks</a>

</body>

</html>

Output:-

Examples of Adding a link

Click on the following link

GeeksforGeeks

4)Define image map? Explain <img> tag with four attributes.


Answer:- Image Map
An image map is a list of coordinates relating to a specific image,
created in order to hyperlink areas of the image to different destinations.

<img>

HTML img tag is used to display image on the web page. HTML img tag
is an empty tag that contains attributes only,closing tags are not used in
html image element.

Syntax:- <img src=”Image URL”…attributes_list/>

<img> Attributes

a) src= The scr stands for source. It is used to specify the path to
the image .
b) alt=The alt attributes defines an alternate text for the image , if it
cannot be displayed.
c) width=It is an optional attribute which is used to specify the
width to display the image.
d) height= It h3 the height of the image. The HTML height attribute
also supports iframe, image and object elements.

5)What is stylesheet? List its types. Explain any one with the example.

Answer:- Stylesheet

A style sheet contains the specifications of a document's layout, such as


the page size, margins, fonts and font sizes.

List

HTML lists are used to display related information in an easy to read and
concise way as lists.

There are three types of lists in HTML

a) Unordered List

b) Ordered List

c) Description List
Unordered List

In HTML Unordered list, all the list items are marked with bullets. It is
also known as bulleted list also. The Unordered list starts with <ul> tag
and list items start with the <li> tag.

Example:-

<!DOCTYPE>

<html>

<body>

<ul>

<li>Aries</li>

<li>Bingo</li>

<li>Leo</li>

<li>Oracle</li>

</ul>

</body>

</html>

Output:-

Aries

Bingo

Leo

Oracle

6)Explain the table tags in html with an example

HTML table tag is used to display data in tabular form (row * column). There can be
many columns in a row.
We can create a table to display data in tabular form, using <table> element, with
the help of <tr> , <td>, and <th> elements.

In Each table, table row is defined by <tr> tag, table header is defined by <th>, and
table data is defined by <td> tags.

Examples:-

<!DOCTYPE>

<html>

<body>

<table>

<tr>

<th>First_Name</th>

<th>Last_Name</th>

<th>Marks</th>

</tr>

<tr>

<td>Sonoo</td>

<td>Jaiswal</td>

<td>60</td>

</tr>

<tr>

<td>James</td>

<td>William</td>

<td>80</td>

</tr>
</table>

</body>

</html>

Output:-

First_Name Last_Name Marks


Sonoo Jaiswal 60
James William 80

7)Explain any five tags used in head section in HTML.

The <head> element is a container for metadata (data about data) and is
placed between the <html> tag and the <body> tag.

The HTML <head> element is a container for the following


elements: <title>, <style>, <meta>, <link>, <script>, and <base>.

a) <title>
The HTML <title> element is used to define the title of the document. It is used in all
HTML/XHTML documents. The <title> element must be placed between <head>
element, and one document can only have one title element.

b) <style>
The HTML <style> element is used to style the HTML page. The <style> element can
have CSS properties for that HTML page only.

c) <meta>
The HTML <meta> element is used to specify the character set, page description,
keywords, authors and other metadata on the webpage.

d) <link>

The HTML <link> element is used to link an external style sheet to your webpage. The
<link> element contains main two attributes which are "rel" and "href"

e) <script>

The <script> element is used to define client-side JavaScripts.


8)Explain checkbox control in html with suitable example.

Answer:-

The HTML <checkbox> tag is used to define the square boxes. It is a form element
which allows users to select one or more options from the given options.

Syntax:-

<input type="checkbox" name="field name" value="Initial value">

Example:-

<html>

<head>

</head>

<body>

<form>

Programming Languages: <br>

<input type="checkbox" id="C" name="C" value="C"/>

<label>C</label> <br>

<input type="checkbox" id="Java" name="Java" value="Java" checked=?yes?/>

<label>Java</label> <br>

</form>

</body>

</html>

Output:-

Programming Languages:
C
Java

8)Explain the Form tags in html with the example.

Answer:- An html form is the collection of different input elements like text fields,
password fields, checkbox, radio buttons, submit button , menus and many more.
Syntax:-
<form> Form Content... </form>
Example:-

<!DOCTYPE html>

<html>

<body>

<h2>The input Element</h2>

<form

<label for="fname">First name:</label>

<input type="text" id="fname" name="fname">

</form>

</body>

</html>

Output:- The input Element


First name:

9)Explain while loop in javascript with example.


Answer:- The JavaScript while loop iterates the elements for the infinite number of
times . It should be used if number of iteration is not known. The syntax of while loop
is given below.

1. while (condition)
2. {
3. code to be executed
4. }

Example:-

<!DOCTYPE html>

<html>

<body>

<script>

var i=11;

while (i<=15)
{

document.write(i + "<br/>");

i++;

</script>

</body>

</html>

Output:-

11

12

13

14

15

You might also like