Unit 2WD
Unit 2WD
HTML stands for "Hypertext Markup Language." It is the standard markup language used to
create web pages. HTML defines the structure and layout of web content, including text,
images, links, and multimedia. Web browsers interpret HTML code to render web pages.
HTML5 is the fifth and current version of HTML. It has improved the markup available for
documents and has introduced application programming interfaces (API) and Document Object
Model (DOM). It has introduced various new features like drag and drop, geo-location services,
multimedia features, easy doctype declaration, offline data storage, graphic elements, and
various semantic tags like the article, section, header, footer, figure, summary, etc. It is
supported by all modern browsers.
HTML5 is the latest version of Hypertext Markup Language and includes three
main components:
1.HTML is a markup language that uses tags to create web pages that can be
viewed in a browser.
2.CSS (Cascading Style Sheets) are used for the layout and design of web
pages.
3.Java Script is a programming language written within an HTML page that
allows for creating interactive effects on web pages.
HTML5:
Some data can be stored on the user’s device, which means apps are cached and
can continue to work properly without an Internet connection.
Web pages can display fonts with a wider array of colors, shadows, and other
beautiful effects.
Objects on the page can be more responsive and can move in response to the
user’s cursor movements.
New elements like section, header, article, and nav can replace most div
elements, which helps eliminate div soups and makes it easier to scan for
mistakes.
Before HTML5 cookies which hold a limited amount of data were the only
reliable way to store data, HTML5’s localStorage provides developers a way to
work around the stateless nature of the HTTP protocol.
Browsers can display interactive 3D graphics using the computer’s own
graphics processor.
By limiting the need for external plugins, HTML5 allows for faster delivery of
more dynamic content.
What is New in HTML5
Audio and Video: HTML5 has two key additions: audio and video tags. It enables
website developers to insert video or music into their pages.
Vector Graphics: This is a new feature in the updated version that has had a
significant impact on the use of Adobe Flash in websites. It may be used to create
visuals using a variety of shapes and colors using scripting, most commonly JS.
Scalable vector graphics are simple to generate and manipulate.
Header and Footer: There is no need to use a div> tag to separate the two elements
with these new tags. The footer appears at the bottom of the page, while the header
appears at the top. The browser will know what to load first and what to load later if
you use the HTML5 elements header and footer.
Figure and Figcaption: The <figure> element in HTML5 can be used to mark up a
photo in a document, and the <figcaption> element can be used to define a caption for
the photo. A caption for a figure element is defined using the <figcaption> tag.
Nav tag: The <nav> tag defines a set of navigation links. It is used for the part of an
internet site that links to different pages on the website.
Progress tag: The progress tag is used to check the progress of a task during the
execution. Progress tag can be used with the conjunction of JavaScript.
Placeholder Attribute: The placeholder attribute offers a brief description of an
input field’s/text area’s intended value. Before the user inputs a value, a small hint
appears in the field.
Email attribute: When the form’s input type is set to email, the browser receives
instructions from the code to write an email in a valid format. The format of the input
email id is automatically verified to ensure that it is correct.
Storage: In HTML, we can utilize the browser as temporary storage, however in
HTML5, we use an application cache, a web SQL database, and web storage.
Ease of use: While HTML5 has hazards, such as constant modifications, the
simplified syntax makes it easier to keep up with changes and updates than other
versions of HTML.
HTML Documents:
An HTML document, also known as an HTML file, is a text file that contains HTML code. It
is the fundamental building block of a web page and includes all the content, formatting, and
structure instructions for a webpage. HTML documents typically have the file extension
".html" or ".htm."
<!DOCTYPE> declaration: Specifies the document type and version of HTML being used.
<html> element: The root element that encapsulates the entire HTML document.
<head> element: Contains metadata about the web page, such as the title, character set, and
links to external resources.
<meta> tags: Provide information about the character set and other attributes of the
document.
<title> element: Sets the title of the web page, which appears in the browser's title bar or tab.
<link> and <style> elements: Used to include external CSS (Cascading Style Sheets) for
styling the page.
<script> element: Used to include external JavaScript for adding interactivity to the page.
<body> element: Contains the visible content of the web page, including text, images, links,
and other media.
HTML Tags:
HTML tags are used to structure and format content on a web page. Tags are enclosed in
angle brackets and come in pairs - an opening tag and a closing tag.
<html>: The root element that wraps the entire HTML document.
<head>: Contains meta-information about the document, like the title and links to external
resources.
<meta>: Provides metadata about the document, such as character encoding.
<title>: Sets the title of the web page.
<link>: Links external resources, often stylesheets (CSS).
<script>: Embeds or links to JavaScript code.
<body>: Contains the visible content of the web page.
<h1>, <h2>, ... <h6>: Define headings of different levels.
<p>: Represents a paragraph.
<a>: Creates hyperlinks.
<img>: Embeds images.
<ul>, <ol>, <li>: Used for creating lists.
<table>, <tr>, <td>, <th>: Structure tabular data within tables.
<iframe>: Embeds another web page within the current page.
Working with Text:
<a>: Creates hyperlinks. The href attribute specifies the URL to link to.
Images and Multimedia:
<img>: Embeds images. The src attribute specifies the image file.
<audio>: Embeds audio content.
<video>: Embeds video content.
Working with Forms and Controls:
<form>: Defines a form.
<input>: Represents an input field (text, radio buttons, checkboxes, etc.).
<select>: Creates a dropdown list.
<textarea>: Defines a multiline text input field.
<button>: Creates a clickable button.
<label>: Defines a label for an input element.
<fieldset>: Groups form controls.
<legend>: Provides a title for a <fieldset>.
HTML is a versatile language that allows you to structure and present content on the web in
various ways. Understanding these fundamental HTML elements is a great starting point for
web development.
Creating a Registration Form Using HTML
<Html>
<head>
<title>
Registration Page
</title>
</head>
<body bgcolor="Lightskyblue">
<br>
<br>
<form>
<label> Firstname </label>
<input type="text" name="firstname" size="15"/> <br> <br>
<label> Middlename: </label>
<input type="text" name="middlename" size="15"/> <br> <br>
<label> Lastname: </label>
<input type="text" name="lastname" size="15"/> <br> <br>
<label> Course : </label>
<select>
<option value="Course">Course</option>
<option value="BCA">BCA</option>
<option value="BBA">BBA</option>
<option value="B.Tech">B.Tech</option>
<option value="MBA">MBA</option>
<option value="MCA">MCA</option>
<option value="M.Tech">M.Tech</option>
</select>
<br>
<br>
<label> Gender :</label><br>
<input type="radio" name="male"/> Male <br>
<input type="radio" name="female"/> Female <br>
<input type="radio" name="other"/> Other
<br>
<br>
<a href=https://www.google.com> this is a link </a>
<label> Phone : </label>
<input type="text" name="country code" value="+91" size="2"/>
<input type="text" name="phone" size="10"/> <br> <br>
Address
<br>
<textarea cols="80" rows="5" value="address">
</textarea>
<br> <br>
Email:
<input type="email" id="email" name="email"/> <br>
<br> <br>
Password:
<input type="Password" id="pass" name="pass"> <br>
<br> <br>
Re-type password:
<input type="Password" id="repass" name="repass"> <br> <br>
<input type="button" value="Submit"/>
</form>
</body>
</html>