0% found this document useful (0 votes)
2 views6 pages

HTML Forms

The document provides an overview of HTML forms, including their structure, input fields, and attributes used for user input collection. It also introduces HTML 5 features such as multimedia support, improved semantic markup, and mobile-friendly design, along with instructions for embedding audio and video. Additionally, it explains the concepts of domain names, web hosting, and CSS for styling web pages.

Uploaded by

rs8731549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

HTML Forms

The document provides an overview of HTML forms, including their structure, input fields, and attributes used for user input collection. It also introduces HTML 5 features such as multimedia support, improved semantic markup, and mobile-friendly design, along with instructions for embedding audio and video. Additionally, it explains the concepts of domain names, web hosting, and CSS for styling web pages.

Uploaded by

rs8731549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

HTML Forms

HTML forms are used to collect user input. They allow users to enter data which is sent to the
server for processing. Forms can contain various types of input fields such as text boxes,
checkboxes, radio buttons, submit buttons, and more.
The syntax for creating a form in HTML is:
<form action="server-side script" method="post/get">
<!-- form elements go here -->
</form>

The action attribute specifies the URL of the server-side script that will handle the form data.
The method attribute specifies how the form data will be sent to the server. The two possible
values for this attribute are post and get.
Input Fields: There are different types of input fields in HTML forms. Some of the commonly
used input fields are:
1. Text Input: <input type="text" name="username">
2. Password Input: <input type="password" name="password">
3. Checkbox: <input type="checkbox" name="remember">
4. Radio Button: <input type="radio" name="gender" value="male">
5. Select Box:
<select name="cars">
<option value="volvo">Volvo</option>
<option value="audi">Audi</option>
<option value="bmw">BMW</option>
</select>
6. Textarea: <textarea name="message"></textarea>
7. Submit Button: <input type="submit" value="Submit">

Form Attributes
There are various attributes that can be used to modify the behavior of a form. Some of the
commonly used form attributes are:
1. autocomplete: Specifies whether or not the browser should autocomplete input values.
2. enctype: Specifies the content type of the data sent to the server.
3. novalidate: Specifies that the form should not be validated when submitted.
4. target: Specifies where to display the response that is received after submitting the
form.
<html>
<head>
<title>Global Academy</title>
</head>
<body bgcolor="sky-blue" margins="100px">
<h2>This is the normal Form</h2>
<form >
<label for="First Name">First Name:</label>
<input type="text" name="First name" id="firstname"><br><br>

<label for="Last Name">Last Name:</label>


<input type="text" name="Last name" id="lastname"><br><br>

<label for="Address">Address:</label>
<input type="text" name="address" id="address"><br><br>

<label for="Email">Email Address:</label>


<input type="email" name="email" id="email"><br><br>

<label for="mobile">Mobile Number:</label>


<input type="tel" id="mobile" name="mobile" required><br><br>

<label for="Password">Password:</label>
<input type="password" name="Password" id="password"><br><br>

<label for="Password">Confirm Password:</label>


<input type="password" name="Confirm password" id="confirmpassword"><br><br>

<label for="gender">Gender:</label>
<select name="gender" id="gender">
<option value="">Select gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br><br>

<input type="button" name="Submit" value="Submit">


<input type="button" name="Reset" value="Reset">

</form>
</body>
</html>
Introduction to HTML 5
HTML 5, or Hypertext Markup Language version 5, is the latest version of the HTML standard
for creating web pages and web applications. It was developed by the World Wide Web
Consortium (W3C) and introduced in 2014.
HTML 5 includes a number of new features and improvements over previous versions of
HTML, including:
1. Better support for multimedia: HTML 5 includes built-in support for audio and video
playback without requiring third-party plugins like Flash. This makes it easier to create
multimedia-rich websites and web applications.
2. Improved semantic markup: HTML 5 includes new semantic markup elements that allow
developers to better describe the structure and content of a web page, making it easier for
search engines and screen readers to understand the page's content.
3. Mobile-friendly design: HTML 5 includes features that make it easier to create web pages
that are optimized for mobile devices, including responsive design, which allows web pages
to adjust their layout and content based on the size of the device screen.
4. Improved forms: HTML 5 includes new form input types and attributes that make it easier
to create more complex and user-friendly forms, including support for date pickers, color
pickers, and range sliders.
5. Offline web applications: HTML 5 includes support for offline web applications, which
can cache web pages and other resources so that users can access them even when they are
not connected to the internet.
Overall, HTML 5 provides web developers with a more powerful and flexible set of tools for
creating websites and web applications that are more multimedia-rich, accessible, and mobile-
friendly.
Embedding Audio
HTML 5 supports <audio> tag which is used to embed sound content in an HTML or XHTML
document as follows:
<audio controls autoplay>
<source src="example.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

<audio controls autoplay>


<source src="example.mp3" type="audio/mpeg">
<source src="example.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>

Some of the common attributes of the <audio> tag are:


 src: Specifies the URL of the audio file to be played.
 controls: Specifies whether or not to display the built-in controls for playing, pausing, and
adjusting the volume of the audio.
 autoplay: Specifies whether or not the audio should automatically start playing when the
page is loaded.
 loop: Specifies whether or not the audio should loop after it has finished playing.
 preload: Specifies whether or not the browser should download the audio file when the
page is loaded.
 muted: Specifies whether or not the audio should be muted by default.
 volume: Specifies the default volume level of the audio.

Embedding Video
<video controls>
<source src="myvideo.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>

Some of the most commonly used attributes of the <video> tag:


 src: This is the URL of the video file that should be played. This is a required attribute.
 controls: This attribute enables the default video controls, such as play/pause, volume, and
full-screen mode.
 autoplay: This attribute makes the video start playing automatically as soon as the page
loads.
 loop: This attribute makes the video restart automatically once it has finished playing.
 muted: This attribute mutes the audio of the video.
 poster: This attribute specifies an image to be shown as a placeholder while the video is
downloading or before it starts playing.
 width and height: These attributes define the dimensions of the video player.
 preload: This attribute specifies whether the video should be loaded when the page loads,
or only when the user clicks the play button.

Concept of Domain name and Web hosting

Domain name

A domain name is a unique address that identifies a website on the internet. It consists of a
name (e.g., google) and a top-level domain (e.g., .com, .org, .net) separated by a dot. Domain
names are used to help users easily find and access websites, and they also play a role in
branding and marketing for businesses and organizations. Domain names are registered and
managed through domain name registrars, which allow individuals and businesses to purchase
and control their own domain names.

Web hosting
Web hosting refers to the process of storing and publishing a website or web application on the
internet. When you create a website, it consists of files such as HTML, CSS, JavaScript, and
images, which need to be stored on a server in order to be accessible online.
Web hosting companies offer services that enable individuals and organizations to publish their
websites on the internet. These companies provide servers, storage space, and other resources
necessary to make a website accessible to visitors.
When you sign up for web hosting, you are essentially renting space on a server to store your
website files. The web hosting company manages the server hardware and software, ensuring
that your website is available to visitors 24/7.
Web hosting plans can vary depending on the needs of the website owner. For example, a small
personal blog might require only basic web hosting with limited storage and bandwidth, while
a large e-commerce site might require dedicated hosting with more resources and higher
security features.
In summary, web hosting is the process of storing and publishing a website or web application
on the internet, and web hosting companies provide the necessary resources and support to
make this possible.

CSS (Cascade Style Sheet)


CSS stands for Cascading Style Sheets, which is a language used to style web pages. CSS
provides developers with a way to separate the design and layout of a website from its content.
This separation allows for greater flexibility, easier maintenance, and faster load times.
There are three main types of CSS:
1. Inline CSS: This is when CSS is applied directly to an HTML element using the style
attribute. Example:
<p style="color: red; font-size: 20px;">This text is red and 20px</p>
2. Internal CSS: This is when CSS is defined within the head section of an HTML document
using the <style> tag. Example:
<!DOCTYPE html>
<html>
<head>
<style>
p{
color: red;
font-size: 20px;
}
</style>
</head>
<body>
<p>This text is red and 20px</p>
</body>
</html>
3. External CSS: This is when CSS is defined in a separate file and linked to an HTML
document using the <link> tag.
Example:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>This text is styled using an external CSS file</p>
</body>
</html>
In the example above, style.css is the name of the external CSS file. Here's what the contents
of that file might look like:
P{
color: blue;
font-size: 24px;
}
This CSS rule sets the color of all <p> elements to blue and the font size to 24 pixels.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy