What Can You Do With HTML?
The types of things that you can do with JavaScript are practically limitless. This programming language can provide you with the tools needed to:
Create a calculator for your website
Create various keyboard shortcuts that allow users to effortlessly navigate to other pages
Play animations when users scroll down the page
Since you can change your HTML and CSS elements with JavaScript, this can be a very beneficial language to learn.
The types of things that you can do with JavaScript are practically limitless. This programming language can provide you with the tools needed to:
Create a calculator for your website
Create various keyboard shortcuts that allow users to effortlessly navigate to other pages
Play animations when users scroll down the page
Since you can change your HTML and CSS elements with JavaScript, this can be a very beneficial language to learn.
Bold Text
Anything that appears within <b>...</b> element, is displayed in bold.
<!DOCTYPE html>
<html>
<head>
<title>Bold Text Example</title>
</head>
<body>
<p>The following word uses a <b>bold</b> typeface.</p>
</body>
</html>
------------------------------------
Italic Text
Anything that appears within <i>...</i> element is displayed in italicized:
Example
<!DOCTYPE html>
<html>
<head>
<title>Italic Text Example</title>
<head>
<body>
<p>The following word uses a <i>italicized</i> typeface.</p>
</body>
</html>
-----------------------------
Underlined Text
Anything that appears within <u>...</u> element, is displayed with underline :
Example
<!DOCTYPE html>
<html>
<head>
<title>Underlined Text Example</title>
</head>
<body>
<p>The following word uses a <u>underlined</u> typeface.</p>
</body>
</html>
------------------------------------
Strike Text
Anything that appears within <strike>...</strike> element is displayed with strikethrough,
which is a thin line through the text :
Example
<!DOCTYPE html>
<html>
<head>
<title>Strike Text Example</title>
</head>
<body>
<p>The following word uses a <strike>strikethrough</strike> typeface.</p>
</body>
</html>
Anything that appears within <b>...</b> element, is displayed in bold.
<!DOCTYPE html>
<html>
<head>
<title>Bold Text Example</title>
</head>
<body>
<p>The following word uses a <b>bold</b> typeface.</p>
</body>
</html>
------------------------------------
Italic Text
Anything that appears within <i>...</i> element is displayed in italicized:
Example
<!DOCTYPE html>
<html>
<head>
<title>Italic Text Example</title>
<head>
<body>
<p>The following word uses a <i>italicized</i> typeface.</p>
</body>
</html>
-----------------------------
Underlined Text
Anything that appears within <u>...</u> element, is displayed with underline :
Example
<!DOCTYPE html>
<html>
<head>
<title>Underlined Text Example</title>
</head>
<body>
<p>The following word uses a <u>underlined</u> typeface.</p>
</body>
</html>
------------------------------------
Strike Text
Anything that appears within <strike>...</strike> element is displayed with strikethrough,
which is a thin line through the text :
Example
<!DOCTYPE html>
<html>
<head>
<title>Strike Text Example</title>
</head>
<body>
<p>The following word uses a <strike>strikethrough</strike> typeface.</p>
</body>
</html>
HTML TAGS
------------------------------------
<strong> … </strong>
Makes text bold. Used to emphasize a point
<b> … </b>
Alternative to the above tag, also creates bold text.
<em> … </em>
Another emphasis tag, but this displays text
in italics.
<i> … </i>
Also used to display text in italics, but does not
emphasize it like the above tag.
<tt> … </tt>
Formatting for typewriter-like text. No longer
supported in HTML5.
<strike> … </strike>
Another old tag, this is used to draw a line at
the center of the text, so as to make it appear
unimportant or no longer useful.
<cite> … </cite>
Tag for citing author of a quote.
<del> … </del>
Pre-formatted, ‘monospace’ text laid out with
whitespace inside the element intact.
<ins> … </ins>
Denotes text that has been inserted into
the webpage.
<blockquote> … </blockquote>
Quotes often go into this tag. Is used in tandem
with the <cite> tag.
<q> … </q>
Similar to the above tag, but for shorter quotes.
<abbr> … </abbr>
Denotes abbreviations, along with the full forms.
<acronym> … </acronym>
Tag for acronyms. No HTML5 support.
<address> … </address>
Tag for specifying author’s contact details.
<dfn> … </dfn>
Tag dedicated for definitions.
<code> … </code>
This is used to display code snippets within
a paragraph.
<sub> … </sub>
Used for writing a subscript (smaller font just
below the mid-point of normal font). Example: ax
<sup> … </sup>
Similar to the above tag, but for superscripting.
<small> … </small>
Reduces text size. In HTML5, it often refers to
redundant or invalid information.
-----------------------------------
Example
<p><strong>Bold text</strong> Regular text
<em>some words in italics</em> regular text
once again.</p>
<blockquote>
Anyone who has never made a mistake has never
tried anything new.<cite>- Albert Einstein</cite>
</blockquote>
<pre>
Some pre-formatted text
</pre>
<p>A code snippet: <code>some code</code></p>
------------------------------------
<strong> … </strong>
Makes text bold. Used to emphasize a point
<b> … </b>
Alternative to the above tag, also creates bold text.
<em> … </em>
Another emphasis tag, but this displays text
in italics.
<i> … </i>
Also used to display text in italics, but does not
emphasize it like the above tag.
<tt> … </tt>
Formatting for typewriter-like text. No longer
supported in HTML5.
<strike> … </strike>
Another old tag, this is used to draw a line at
the center of the text, so as to make it appear
unimportant or no longer useful.
<cite> … </cite>
Tag for citing author of a quote.
<del> … </del>
Pre-formatted, ‘monospace’ text laid out with
whitespace inside the element intact.
<ins> … </ins>
Denotes text that has been inserted into
the webpage.
<blockquote> … </blockquote>
Quotes often go into this tag. Is used in tandem
with the <cite> tag.
<q> … </q>
Similar to the above tag, but for shorter quotes.
<abbr> … </abbr>
Denotes abbreviations, along with the full forms.
<acronym> … </acronym>
Tag for acronyms. No HTML5 support.
<address> … </address>
Tag for specifying author’s contact details.
<dfn> … </dfn>
Tag dedicated for definitions.
<code> … </code>
This is used to display code snippets within
a paragraph.
<sub> … </sub>
Used for writing a subscript (smaller font just
below the mid-point of normal font). Example: ax
<sup> … </sup>
Similar to the above tag, but for superscripting.
<small> … </small>
Reduces text size. In HTML5, it often refers to
redundant or invalid information.
-----------------------------------
Example
<p><strong>Bold text</strong> Regular text
<em>some words in italics</em> regular text
once again.</p>
<blockquote>
Anyone who has never made a mistake has never
tried anything new.<cite>- Albert Einstein</cite>
</blockquote>
<pre>
Some pre-formatted text
</pre>
<p>A code snippet: <code>some code</code></p>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Register Form Start</title>
<link rel="stylesheet" href="style.css">
<style type="text/css">
@import url('httpss://fonts.googleapis.com/css?family=Roboto');
body {
background:linear-gradient(to right, #78a7ba 0%, #385D6C 50%, #78a7ba 99%);
}
.signup-form {
font-family: "Roboto", sans-serif;
width:650px;
margin:30px auto;
background:linear-gradient(to right, #ffffff 0%, #fafafa 50%, #ffffff 99%);
border-radius: 10px;
}
.form-header {
background-color: #EFF0F1;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.form-header h1 {
font-size: 30px;
text-align:center;
color:#666;
padding:20px 0;
border-bottom:1px solid #cccccc;
}
/*---------------------------------------*/
/* Form Body */
/*---------------------------------------*/
.form-body {
padding:10px 40px;
color:#666;
}
.form-group{
margin-bottom:20px;
}
.form-body .label-title {
color:#1BBA93;
font-size: 17px;
font-weight: bold;
}
.form-body .form-input {
font-size: 17px;
box-sizing: border-box;
width: 100%;
height: 34px;
padding-left: 10px;
padding-right: 10px;
color: #333333;
text-align: left;
border: 1px solid #d6d6d6;
border-radius: 4px;
background: white;
outline: none;
}
.horizontal-group .left{
float:left;
width:49%;
}
.horizontal-group .right{
float:right;
width:49%;
}
input[type="file"] {
outline: none;
cursor:pointer;
font-size: 17px;
}
#range-label {
width:15%;
padding:5px;
background-color: #1BBA93;
color:white;
border-radius: 5px;
font-size: 17px;
position: relative;
top:-8px;
}
::-webkit-input-placeholder {
color:#d9d9d9;
}
/*---------------------------------------*/
/* Form Footer */
/*---------------------------------------*/
.form-footer {
clear:both;
}
/*---------------------------------------*/
/* Form Footer */
/*---------------------------------------*/
.signup-form .form-footer {
background-color: #EFF0F1;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding:10px 40px;
text-align: right;
border-top: 1px solid #cccccc;
}
.form-footer span {
float:left;
margin-top: 10px;
color:#999; font-style: italic;
font-weight: thin;
}
.btn {
display:inline-block;
padding:10px 20px;
background-color: #1BBA93;
font-size:17px;
border:none;
border-radius:5px;
color:#bcf5e7;
cursor:pointer;
}
.btn:hover {
background-color: #169c7b;
color:white;
}
</style>
<script type="text/javascript">
<!-- Script for range input label -->
<script>
var rangeLabel = document.getElementById("range-label");
var experience = document.getElementById("experience");
function change() {
rangeLabel.innerText = experience.value + "K";
}
</script>
</head>
<body>
<form class="signup-form" action="/register" method="post">
</form>
<form class="signup-form" action="/register" method="post">
<!-- form header -->
<div class="form-header">
</div>
<!-- form body -->
<div class="form-body">
</div> <!-- form footer -->
<div class="form-footer">
</div>
</form>
<!-- form header -->
<div class="form-header">
<h1>Create Account</h1>
</div>
<!-- form body -->
<div class="form-body">
<!-- Firstname and Lastname -->
<div class="horizontal-group">
<div class="form-group left">
<label for="firstname" class="label-title">First name *</label>
<input type="text" id="firstname" class="form-input" placeholder="enter your first name" required="required" />
</div>
<div class="form-group right">
<label for="lastname" class="label-title">Last name</label>
<input type="text" id="lastname" class="form-input" placeholder="enter your last name" />
</div>
</div>
</div>
<!-- Email -->
<div class="form-group">
<label for="email" class="label-title">Email*</label>
<input type="email" id="email" class="form-input" placeho
<html>
<head>
<meta charset="utf-8">
<title>Register Form Start</title>
<link rel="stylesheet" href="style.css">
<style type="text/css">
@import url('httpss://fonts.googleapis.com/css?family=Roboto');
body {
background:linear-gradient(to right, #78a7ba 0%, #385D6C 50%, #78a7ba 99%);
}
.signup-form {
font-family: "Roboto", sans-serif;
width:650px;
margin:30px auto;
background:linear-gradient(to right, #ffffff 0%, #fafafa 50%, #ffffff 99%);
border-radius: 10px;
}
.form-header {
background-color: #EFF0F1;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.form-header h1 {
font-size: 30px;
text-align:center;
color:#666;
padding:20px 0;
border-bottom:1px solid #cccccc;
}
/*---------------------------------------*/
/* Form Body */
/*---------------------------------------*/
.form-body {
padding:10px 40px;
color:#666;
}
.form-group{
margin-bottom:20px;
}
.form-body .label-title {
color:#1BBA93;
font-size: 17px;
font-weight: bold;
}
.form-body .form-input {
font-size: 17px;
box-sizing: border-box;
width: 100%;
height: 34px;
padding-left: 10px;
padding-right: 10px;
color: #333333;
text-align: left;
border: 1px solid #d6d6d6;
border-radius: 4px;
background: white;
outline: none;
}
.horizontal-group .left{
float:left;
width:49%;
}
.horizontal-group .right{
float:right;
width:49%;
}
input[type="file"] {
outline: none;
cursor:pointer;
font-size: 17px;
}
#range-label {
width:15%;
padding:5px;
background-color: #1BBA93;
color:white;
border-radius: 5px;
font-size: 17px;
position: relative;
top:-8px;
}
::-webkit-input-placeholder {
color:#d9d9d9;
}
/*---------------------------------------*/
/* Form Footer */
/*---------------------------------------*/
.form-footer {
clear:both;
}
/*---------------------------------------*/
/* Form Footer */
/*---------------------------------------*/
.signup-form .form-footer {
background-color: #EFF0F1;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding:10px 40px;
text-align: right;
border-top: 1px solid #cccccc;
}
.form-footer span {
float:left;
margin-top: 10px;
color:#999; font-style: italic;
font-weight: thin;
}
.btn {
display:inline-block;
padding:10px 20px;
background-color: #1BBA93;
font-size:17px;
border:none;
border-radius:5px;
color:#bcf5e7;
cursor:pointer;
}
.btn:hover {
background-color: #169c7b;
color:white;
}
</style>
<script type="text/javascript">
<!-- Script for range input label -->
<script>
var rangeLabel = document.getElementById("range-label");
var experience = document.getElementById("experience");
function change() {
rangeLabel.innerText = experience.value + "K";
}
</script>
</head>
<body>
<form class="signup-form" action="/register" method="post">
</form>
<form class="signup-form" action="/register" method="post">
<!-- form header -->
<div class="form-header">
</div>
<!-- form body -->
<div class="form-body">
</div> <!-- form footer -->
<div class="form-footer">
</div>
</form>
<!-- form header -->
<div class="form-header">
<h1>Create Account</h1>
</div>
<!-- form body -->
<div class="form-body">
<!-- Firstname and Lastname -->
<div class="horizontal-group">
<div class="form-group left">
<label for="firstname" class="label-title">First name *</label>
<input type="text" id="firstname" class="form-input" placeholder="enter your first name" required="required" />
</div>
<div class="form-group right">
<label for="lastname" class="label-title">Last name</label>
<input type="text" id="lastname" class="form-input" placeholder="enter your last name" />
</div>
</div>
</div>
<!-- Email -->
<div class="form-group">
<label for="email" class="label-title">Email*</label>
<input type="email" id="email" class="form-input" placeho
lder="enter your email" required="required">
</div>
<!-- Passwrod and confirm password -->
<div class="horizontal-group">
<div class="form-group left">
<label for="password" class="label-title">Password *</label>
<input type="password" id="password" class="form-input" placeholder="enter your password" required="required">
</div>
<div class="form-group right">
<label for="confirm-password" class="label-title">Confirm Password *</label>
<input type="password" class="form-input" id="confirm-password" placeholder="enter your password again" required="required">
</div>
</div>
<!-- Gender and Hobbies -->
<div class="horizontal-group">
<div class="form-group left">
<label class="label-title">Gender:</label>
<div class="input-group">
<label for="male">
<input type="radio" name="gender" value="male" id="male"> Male</label>
<label for="female">
<input type="radio" name="gender" value="female" id="female"> Female</label>
</div>
</div>
<div class="form-group right">
<label class="label-title">Hobbies</label>
<div>
<label>
<input type="checkbox" value="Web">Music</label>
<label>
<input type="checkbox" value="iOS">Sports</label>
<label>
<input type="checkbox" value="Andriod">Travel</label>
<label>
<input type="checkbox" value="Game">Movies</label>
</div>
</div> </div>
<!-- Source of Income and Income Amount -->
<div class="horizontal-group">
<div class="form-group left" >
<label class="label-title">Source of Income</label>
<select class="form-input" id="level" >
<option value="B">Employed</option>
<option value="I">Self-employed</option>
<option value="A">Unemployed</option>
</select>
</div> <div class="form-group right">
<label for="experience" class="label-title">Income</label>
<input type="range" min="20" max="100" step="5" value="0" id="experience" class="form-input" onChange="change();" style="height:28px;width:78%;padding:0;">
<span id="range-label">20K</span>
</div>
</div>
<!-- Profile picture and Age -->
<div class="horizontal-group">
<div class="form-group left" >
<label for="choose-file" class="label-title">Upload Profile Picture</label>
<input type="file" id="choose-file" size="80">
</div> <div class="form-group right">
<label for="experience" class="label-title">Age</label>
<input type="number" min="18" max="80" value="18" class="form-input">
</div>
</div>
<!-- Bio -->
<div class="form-group">
<label for="choose-file" class="label-title">Bio</label>
<textarea class="form-input" rows="4" cols="50" style="height:auto"></textarea>
</div>
<!-- form footer -->
<div class="form-footer">
<span>* required</span>
<button type="submit" class="btn">Create</button>
</div>
</body>
</html>
</div>
<!-- Passwrod and confirm password -->
<div class="horizontal-group">
<div class="form-group left">
<label for="password" class="label-title">Password *</label>
<input type="password" id="password" class="form-input" placeholder="enter your password" required="required">
</div>
<div class="form-group right">
<label for="confirm-password" class="label-title">Confirm Password *</label>
<input type="password" class="form-input" id="confirm-password" placeholder="enter your password again" required="required">
</div>
</div>
<!-- Gender and Hobbies -->
<div class="horizontal-group">
<div class="form-group left">
<label class="label-title">Gender:</label>
<div class="input-group">
<label for="male">
<input type="radio" name="gender" value="male" id="male"> Male</label>
<label for="female">
<input type="radio" name="gender" value="female" id="female"> Female</label>
</div>
</div>
<div class="form-group right">
<label class="label-title">Hobbies</label>
<div>
<label>
<input type="checkbox" value="Web">Music</label>
<label>
<input type="checkbox" value="iOS">Sports</label>
<label>
<input type="checkbox" value="Andriod">Travel</label>
<label>
<input type="checkbox" value="Game">Movies</label>
</div>
</div> </div>
<!-- Source of Income and Income Amount -->
<div class="horizontal-group">
<div class="form-group left" >
<label class="label-title">Source of Income</label>
<select class="form-input" id="level" >
<option value="B">Employed</option>
<option value="I">Self-employed</option>
<option value="A">Unemployed</option>
</select>
</div> <div class="form-group right">
<label for="experience" class="label-title">Income</label>
<input type="range" min="20" max="100" step="5" value="0" id="experience" class="form-input" onChange="change();" style="height:28px;width:78%;padding:0;">
<span id="range-label">20K</span>
</div>
</div>
<!-- Profile picture and Age -->
<div class="horizontal-group">
<div class="form-group left" >
<label for="choose-file" class="label-title">Upload Profile Picture</label>
<input type="file" id="choose-file" size="80">
</div> <div class="form-group right">
<label for="experience" class="label-title">Age</label>
<input type="number" min="18" max="80" value="18" class="form-input">
</div>
</div>
<!-- Bio -->
<div class="form-group">
<label for="choose-file" class="label-title">Bio</label>
<textarea class="form-input" rows="4" cols="50" style="height:auto"></textarea>
</div>
<!-- form footer -->
<div class="form-footer">
<span>* required</span>
<button type="submit" class="btn">Create</button>
</div>
</body>
</html>
☝️☝️☝️☝️☝️☝️☝️☝️☝️☝️☝️☝️
HTML WEB SOURCE CODE TRY TO CODE THIS.
Please share and join this channel
https://telegram.me/codehtmlcss
HTML WEB SOURCE CODE TRY TO CODE THIS.
Please share and join this channel
https://telegram.me/codehtmlcss
<h1..h6> … </h1..h6>
Six different variations of writing a heading.
<h1> has the largest font size, while <h6> has
the smallest.
<div> … </div>
A webpage’s content is usually divided into
blocks, specified by the div tag.
<span> … </span>
This tag injects inline elements, like an image,
icon, emoticon without ruining the formatting
/ styling of the page.
<p> … </p>
Plain text is placed inside this tag.
<br/>
A line break for webpages. Is used when
wanting to write a new line.
Six different variations of writing a heading.
<h1> has the largest font size, while <h6> has
the smallest.
<div> … </div>
A webpage’s content is usually divided into
blocks, specified by the div tag.
<span> … </span>
This tag injects inline elements, like an image,
icon, emoticon without ruining the formatting
/ styling of the page.
<p> … </p>
Plain text is placed inside this tag.
<br/>
A line break for webpages. Is used when
wanting to write a new line.
<hr/>
Similar to the above tag. But in addition to
switching to the next line, this tag also draws
a horizontal bar to indicate the end
of the section.
Example
<div>
<h1>Top 5 Greatest Films</h1>
<p>These are considered the greatest
<span>reel-icon</span> of all time </p>
<hr/>
<h2>1. The Godfather</h2>
<p>This 1972 classic stars Marlon Brando and
Al Pacino.</p>
</div>
Similar to the above tag. But in addition to
switching to the next line, this tag also draws
a horizontal bar to indicate the end
of the section.
Example
<div>
<h1>Top 5 Greatest Films</h1>
<p>These are considered the greatest
<span>reel-icon</span> of all time </p>
<hr/>
<h2>1. The Godfather</h2>
<p>This 1972 classic stars Marlon Brando and
Al Pacino.</p>
</div>
FORM
<form> … </form>
The parent tag for an HTML form.
action=”url”
The URL listed here is where the form data
will be submitted once user fills it.
method=””
It specifies which HTTP method (POST or GET)
would be used to submit the form.
enctype=””
Only for POST method, this dictates the data
encoding scheme to be used when form
is submitted.
autocomplete
Determines if the form has auto-complete enabled.
novalidate
Determines whether the form should be validated
before submission.
accept-charsets
Determines character encodings when form
is submitted.
target
After submission, the form response is displayed
wherever this refers to, usually has the following
values: _blank, _self, _parent, _top
<fieldset> … </fieldset>
Identifies the group of all fields on the form.
<label> … </label>
This is used to label a field in the form.
<legend> … </legend>
This operates as a caption for the <fieldset>
element.
<input />
This tag is used to take input from the user.
Input type is determined by a number of attributes.
<form> … </form>
The parent tag for an HTML form.
action=”url”
The URL listed here is where the form data
will be submitted once user fills it.
method=””
It specifies which HTTP method (POST or GET)
would be used to submit the form.
enctype=””
Only for POST method, this dictates the data
encoding scheme to be used when form
is submitted.
autocomplete
Determines if the form has auto-complete enabled.
novalidate
Determines whether the form should be validated
before submission.
accept-charsets
Determines character encodings when form
is submitted.
target
After submission, the form response is displayed
wherever this refers to, usually has the following
values: _blank, _self, _parent, _top
<fieldset> … </fieldset>
Identifies the group of all fields on the form.
<label> … </label>
This is used to label a field in the form.
<legend> … </legend>
This operates as a caption for the <fieldset>
element.
<input />
This tag is used to take input from the user.
Input type is determined by a number of attributes.
INPUT TYPE ATTRIBUTE
type=””
Determines which type of input (text, dates,
password) is requested from the user.
name=””
Specifies the name of the input field.
value=””
Specifies the value contained currently in
the input field.
size=””
Determines the input element width
(number of characters).
maxlength=””
Specifies the most input field characters allowed.
required
Makes an input field compulsory to be filled by
the user. The form cannot be submitted if a required
field is left empty.
width=””
Determines the width of the input element,
in pixel values.
height=””
Determines the height of the input element,
in pixel values.
placeholder=””
Can be used to give hints to the user about the nature
of the requested data.
pattern=””
Specifies a regular expression, which can be used to
look for patterns in the user’s text.
min=””
The minimum value allowed for an <input> element.
max=””
The maximum value allowed for an <input> element.
autofocus
Forces focus on the input element when webpage
loads completely.
disabled
Disables the input element. User can no longer
enter data.
type=””
Determines which type of input (text, dates,
password) is requested from the user.
name=””
Specifies the name of the input field.
value=””
Specifies the value contained currently in
the input field.
size=””
Determines the input element width
(number of characters).
maxlength=””
Specifies the most input field characters allowed.
required
Makes an input field compulsory to be filled by
the user. The form cannot be submitted if a required
field is left empty.
width=””
Determines the width of the input element,
in pixel values.
height=””
Determines the height of the input element,
in pixel values.
placeholder=””
Can be used to give hints to the user about the nature
of the requested data.
pattern=””
Specifies a regular expression, which can be used to
look for patterns in the user’s text.
min=””
The minimum value allowed for an <input> element.
max=””
The maximum value allowed for an <input> element.
autofocus
Forces focus on the input element when webpage
loads completely.
disabled
Disables the input element. User can no longer
enter data.
Exampe👇👇👇👇☝️☝️
<form action="form_submit.php" method="post">
<fieldset>
<legend>Bio:</legend>
First name:<br>
<input type="text" name="first-name"
value="John" placeholder="Please
enter your first name here"><br>
Last name:<br>
<input type="text" name="last-name"
value="Doe" placeholder="Please
enter your last name here"><br><br>
Favorite sport:<br>
<select>
<option value="soccer">Soccer
</option>
<option value="tennis">Tennis
</option>
<option value="golf">Golf
</option>
</select>
<textarea name="description">
</textarea>
<input type="submit" value="Submit">
</fieldset>
</form>
<form action="form_submit.php" method="post">
<fieldset>
<legend>Bio:</legend>
First name:<br>
<input type="text" name="first-name"
value="John" placeholder="Please
enter your first name here"><br>
Last name:<br>
<input type="text" name="last-name"
value="Doe" placeholder="Please
enter your last name here"><br><br>
Favorite sport:<br>
<select>
<option value="soccer">Soccer
</option>
<option value="tennis">Tennis
</option>
<option value="golf">Golf
</option>
</select>
<textarea name="description">
</textarea>
<input type="submit" value="Submit">
</fieldset>
</form>
👉HTML ATTRIBUTES
We have seen few HTML tags and their usage like heading tags <h1>, <h2>, paragraph tag
<p> and other tags. We used them so far in their simplest form, but most of the HTML tags
can also have attributes, which are extra bits of information.
An attribute is used to define the characteristics of an HTML element and is placed inside the
element's opening tag. All attributes are made up of two parts: a name and a value:
The name is the property you want to set. For example, the paragraph <p> element
in the example carries an attribute whose name is align, which you can use to indicate
the alignment of paragraph on the page.
The value is what you want the value of the property to be set and always put within
quotations. The below example shows three possible values of align attribute: left,
center and right.
Attribute names and attribute values are case-insensitive. However, the World Wide Web
Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4
recommendation.
We have seen few HTML tags and their usage like heading tags <h1>, <h2>, paragraph tag
<p> and other tags. We used them so far in their simplest form, but most of the HTML tags
can also have attributes, which are extra bits of information.
An attribute is used to define the characteristics of an HTML element and is placed inside the
element's opening tag. All attributes are made up of two parts: a name and a value:
The name is the property you want to set. For example, the paragraph <p> element
in the example carries an attribute whose name is align, which you can use to indicate
the alignment of paragraph on the page.
The value is what you want the value of the property to be set and always put within
quotations. The below example shows three possible values of align attribute: left,
center and right.
Attribute names and attribute values are case-insensitive. However, the World Wide Web
Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4
recommendation.
Example
<!DOCTYPE html>
<html>
<head>
<title>Align Attribute Example</title>
</head>
<body>
<p align="left">This is left aligned</p>
<p align="center">This is center aligned</p>
<p align="right">This is right aligned</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Align Attribute Example</title>
</head>
<body>
<p align="left">This is left aligned</p>
<p align="center">This is center aligned</p>
<p align="right">This is right aligned</p>
</body>
</html>
👉CORE ATTRIBUTES
The four core attributes that can be used on the majority of HTML elements (although not all)
are:
Id
Title
Class
Style
The four core attributes that can be used on the majority of HTML elements (although not all)
are:
Id
Title
Class
Style
👉The Id Attribute
The id attribute of an HTML tag can be used to uniquely identify any element within an HTML
page. There are two primary reasons that you might want to use an id attribute on an
element:
If an element carries an id attribute as a unique identifier, it is possible to identify just
that element and its content.
If you have two elements of the same name within a Web page (or style sheet), you
can use the id attribute to distinguish between elements that have the same name.
We will discuss style sheet in separate tutorial. For now, let's use the id attribute to distinguish
between two paragraph elements as shown below.
Example
<p id="html">This para explains what is HTML</p>
<p id="css">This para explains what is Cascading Style Sheet</p>
The id attribute of an HTML tag can be used to uniquely identify any element within an HTML
page. There are two primary reasons that you might want to use an id attribute on an
element:
If an element carries an id attribute as a unique identifier, it is possible to identify just
that element and its content.
If you have two elements of the same name within a Web page (or style sheet), you
can use the id attribute to distinguish between elements that have the same name.
We will discuss style sheet in separate tutorial. For now, let's use the id attribute to distinguish
between two paragraph elements as shown below.
Example
<p id="html">This para explains what is HTML</p>
<p id="css">This para explains what is Cascading Style Sheet</p>
👉The title Attribute
The title attribute gives a suggested title for the element. They syntax for the title attribute
is similar as explained for id attribute:
The behavior of this attribute will depend upon the element that carries it, although it is often
displayed as a tooltip when cursor comes over the element or while the element is loading.
Example
<!DOCTYPE html>
<html>
<head>
<title>The title Attribute Example</title>
</head>
<body>
<h3 title="Hello HTML!">Titled Heading Tag Example</h3>
</body>
</html>
The title attribute gives a suggested title for the element. They syntax for the title attribute
is similar as explained for id attribute:
The behavior of this attribute will depend upon the element that carries it, although it is often
displayed as a tooltip when cursor comes over the element or while the element is loading.
Example
<!DOCTYPE html>
<html>
<head>
<title>The title Attribute Example</title>
</head>
<body>
<h3 title="Hello HTML!">Titled Heading Tag Example</h3>
</body>
</html>