HTML 1
HTML 1
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.
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>
If you want to mark or highlight a text, you should write the content within
<mark>.........</mark>.
Example:-
<!DOCTYPE>
<html>
<body>
</body>
</html>
Output:-
c) Underlined Text
<!DOCTYPE>
<html>
<body>
</body>
</html>
d) Deleted Text
Example:-
<!DOCTYPE>
<html>
<body>
</body>
</html>
Output:-
Hello
[e)] Small ElementDelete your first paragraph.
Example:-
<html>
<body>
<p><small>This is a paragraph</small></p>
</body>
</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.
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 .
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:-
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>
<body>
<a href="https://www.geeksforgeeks.org">GeeksforGeeks</a>
</body>
</html>
Output:-
GeeksforGeeks
<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.
<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
List
HTML lists are used to display related information in an easy to read and
concise way as lists.
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
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:-
The <head> element is a container for metadata (data about data) and is
placed between the <html> tag and the <body> tag.
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>
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:-
Example:-
<html>
<head>
</head>
<body>
<form>
<label>C</label> <br>
<label>Java</label> <br>
</form>
</body>
</html>
Output:-
Programming Languages:
C
Java
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>
<form
</form>
</body>
</html>
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