HTML Questions Unit-1
HTML Questions Unit-1
HTML Questions Unit-1
Limitation of HTML 4
1-No Cool Videos and Sounds: HTML4 couldn't easily play videos or
sounds on websites.
4-Not Friendly for All People: People with disabilities had a hard
time using websites made with HTML4 because it didn't help them
much.
5-Not Great with Forms: Forms on HTML4 websites were basic and
didn't check if you filled things out right.
6-Messy Styles: Making websites look pretty with colors and fonts
was messy and confusing.
10-No Tag Team: HTML4 didn't have special tags to explain what
things meant, which confused search engines and people using
special devices.
Advantages of HTML5:
Advantages.
Cool Multimedia: HTML5 lets websites show videos and play sounds
without needing extra stuff like plugins.
Interactive Fun: Websites made with HTML5 can do fun stuff like
games and animations that react when you touch or click them.
Stylish Styles: Making websites pretty with colors, fonts, and spacing
is easier and looks great.
Fit for Any Screen: HTML5 websites look good on all sorts of
devices, from phones to big screens.
Tag Team: HTML5 has special tags that explain what things mean,
helping search engines and people using special devices
understand better.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My First HTML5 Document</title>
</head>
<body>
<header>
<h1>Hello, World!</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<section>
<h2>About Me</h2>
<p>This is my first HTML5 document.</p>
</section>
<footer>
</footer>
</body>
</html>
HTML5 removed several elements that were part of HTML 4.01. Here
is a list of some significant HTML 4.01 elements that were removed in
HTML5:
1. <applet>: The <applet> element, used for embedding Java
applets, was removed in HTML5. It is no longer supported in modern
browsers, which now rely on alternative technologies like JavaScript
or HTML5-based solutions for similar functionality.
2. <basefont>: The <basefont> element, used for specifying the
base font size for a document, was removed in HTML5. The
recommended approach in HTML5 is to use CSS to define font styles
and sizes.
3. <center>: The <center> element, used for centering text or other
content horizontally within a container, was deprecated in HTML4 and
removed in HTML5. CSS should be used instead to control the
alignment and positioning of content.
4. <dir>: The <dir> element, used for creating directory lists, was
removed in HTML5. The <ul> (unordered list) or <ol> (ordered list)
elements should be used instead to create lists.
5. <font>: The <font> element, used for specifying font-related
attributes like size, color, and face, was deprecated in HTML4 and
removed in HTML5. CSS should be used to define font styles and
properties.
6. <isindex>: The <isindex> element, used for creating a single-line
text input field with a prompt, was removed in HTML5.
The <input> element should be used instead, with appropriate
attributes and labels.
7. <s> and <strike>: The <s> and <strike> elements, used for
strikethrough text, were removed in HTML5. CSS should be used to
style and modify text appearance.
8. <u>: The <u> element, used for underlining text, was removed in
HTML5. CSS should be used for text styling, including underlining if
needed.
9. <menu>: The <menu> element, used for creating contextual menus
and dropdown menus, was removed in HTML5. The recommended
approach for creating menus is to use
nested <ul> and <li> elements, along with CSS.
Q6: Explain header, footer, and navigation elements with
example.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<header>
<h1>My Website</h1>
<p>Welcome to my website!</p>
</header>
<!-- Rest of the page content -->
</body>
</html>
Footer Element (<footer>):
The <footer> element is used to define the footer of a
document or a section. It typically contains information about
the author, copyright notices, links to related documents, and
other relevant details.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<footer>
<p>© 2023 My Website. All rights reserved.</p>
</footer>
</body>
</html>
The global attributes are attributes that can be used with all
HTML elements.
Attribute Description
class Specifies one or more classnames for an element (refers to a class in a style sheet)
spellcheck Specifies whether the element is to have its spelling and grammar checked or not