Professional Documents
Culture Documents
HTML
HTML
HTML
The purpose of a web browser is to read HTML documents and display them
correctly. A browser does not display the HTML tags but uses them to
determine how to display the document.
The HTML document itself begins with <html> and ends with </html>.
The metadata about the HTML document is between <head> and </head>.
The visible part of the HTML document is between <body> and </body>.
Web pages can be created and modified using any simple text editor or any
professional HTML editor.
Open a text editor – Write HTML – Save the page – Open in a browser
Some elements do not have content – and are called empty elements which do
not have an end tag. <tagName> or <tagName />.
Attributes
Browsers automatically add some white space (a margin) before and after a
heading.
Search engines use the headings to index the structure and content of web
pages.
Users often skim a page by its headings.
It is important to use headings to show the document structure.
<h1> headings should be used for main headings, followed by <h2> headings,
then the less important <h3> and so on.
Only use one <h1> per page – this should represent the main heading/subject
for the whole page.
Also, do not skip heading levels – start with <h1>, then use <h2>, so on.
Specify the size for any heading with the style attribute using the CSS
font-size property.
Paragraphs
One cannot be sure how HTML will be displayed. Large or small screens and
resized windows will create different results.
With HTML, one cannot change the display by adding extra spaces or extra
lines in HTML code.
The browser will automatically remove any extra spaces and lines when the
page is displayed.
The <hr> tag defines a thematic break in an HTML page and is most often
displayed as a horizontal rule.
The text will be displayed exactly as written in the HTML source code.
Styles
The HTML style attribute is used to add styles to an element (color, font,
size and more).
Setting the style of an HTML element can be done with the style attribute.
HTML contains several elements for defining text with a special meaning.
This tag defines text that has been inserted into a document.
Browsers will usually underline inserted text.
Use CSS to change the rendering.
This tag defines text that has been deleted from a document.
Browsers will usually strike a line through deleted text.
Use CSS to change the rendering.
The cite attribute can specify the URL of the source of the quote.
<blockquote cite="URL"> content </blockquote>
The cite attribute can specify the URL of the source of the quote.
<q cite="URL"> content </q>
This tag defines the contact information for the author/owner of a document
or an article.
The contact information can be an email address, URL, physical address,
phone number, social media handle, so on.
The element content usually renders in italic and browsers will always add a
line break before and after the element.
<address> content </address>
This tag defines the title of a creative work (book, poem, song, movie,
painting, sculpture, so on).
The text in the element usually renders in italic.
<cite> content </cite>
HTML comments are not displayed in the browser, but they can help document
HTML source code.
Add comments to HTML source as: <!-- comment -->.
Colors
HTML colors are specified with predefined color names, or with RGB, HEX,
HSL, RGBA, HSLA values.
An RGB color value represents RED, GREEN and BLUE light sources.
An RGBA color value is an extension of RGB with an Alpha channel (opacity).
Specify a color as an RGB value as: rgb(red, green, blue), each parameter
defines the intensity of the color with a value between 0 and 255.
(There are 16777216 possible colors – 256 × 256 × 256)
Shades of gray are often defined using equal values for all three
parameters.
Shades of gray are often defined using equal values for all three
parameters.
Hue is a degree on the color wheel from 0-360. (0 is red, 120 is green, 240
is blue).
Saturation is a percentage value (0% is a shade of gray, 100% is the full
color). It can be described as the intensity of a color. 100% is pure color,
no shades of gray. 50% is 50% gray but the color is seen. 0% is completely
gray and color is no longer seen.
Shades of gray are often defined by setting the hue and saturation to 0 and
adjust the lightness from 0% to 100% to get darker/lighter shades.
The word cascading means that a style applied to a parent element will also
apply to all child elements within the parent, unless some other style is
specified.
The most common way to add CSS is to keep the styles in external CSS files.
An external style sheet is used to define the style for many HTML pages. To
use an external style sheet add a link to it in the <head> section of each
HTML page. The external style sheet must not contain any HTML code and must
be saved with a .css extension. With an external style sheet change the look
of an entire web site by changing one file. External style sheets can be
referenced with a full URL or with a path relative to the current web page.
The <style> tag is used to define style information (CSS) for a document.
Inside the <style> element specify how HTML elements should render in a
browser. When a browser reads a style sheet it will format the HTML document
according to the information in the style sheet. If some properties have
been defined for the same selector in different style sheets, the value from
the last read style sheet will be used.
The type attribute has a default value of text/css.
The <link> tag defines the relationship between the current document and an
external resource. It is most often used to link to external style sheets.
It is an empty element; it contains attributes only.
Its href attribute gives the URL of the linked document.
Its rel attribute has a value of stylesheet and gives the relationship
between current document and linked resource.
The type attribute can have the value text/css and gives the media type and
can be inferred from rel attribute value.
Links
HTML links are hyperlinks. Click on a link and jump to another document.
When the mouse is moved over a link, mouse arrow will turn into a little
hand.
A link need not be text, it can be an image or any other HTML element.
By default the linked page will be displayed in the current browser window.
To change this specify another target for the link.
The target attribute specifies where to open the linked document.
It can have one of the following values:
_self – default, opens the document in the same window/tab as it was clicked
_blank – opens the document in a new window/tab
_parent – opens the document in the parent frame
_top – opens the document in the full body of the window
The URL can be absolute (full web address) or relative (link to a page
within the same website).
To use an image as a link put the <img> tag inside the <a> tag.
Use mailto: inside the href attribute to create a link that opens the user's
email program.
To use an HTML button as a link add JS code which allows to specify what
happens at certain events.
The download attribute specifies that the target will be downloaded when a
user clicks on the hyperlink. This attribute is only used if the href
attribute is set. The value of the attribute will be the name of the
downloaded file. There are no restrictions on the allowed values and the
browser will automatically detect the correct file extension and add it to
the file. If the value is omitted, the original filename is used.
<a download="filename"> Filename is optional and specifies the new file name
Link to a JavaScript:
<a href="javascript: alert('some message');">Execute JS</a>
Images can improve the design and the appearance of a web page.
Images are not technically inserted into a web page – they are linked to web
pages. The <img> tag creates a holding space for the referenced image.
The <img> tag is empty, it contains attributes only, and does not have a
closing tag.
The required src attribute specifies the URL/path to the image. When a web
page loads, it is the browser, at that moment, that gets the image from a
web server and inserts it into the page. A broken link icon is shown if the
browser cannot find the image.
The required alt attribute provides an alternate text for an image, if the
user for some reason cannot view it. The value of the alt attribute should
describe the image. If the browser cannot find an image, it will display the
value of the alt attribute.
Use the style attribute to specify the width and height (as CSS properties)
of an image or use the width and height attributes. The width and height
attributes always define the width and height of the image in pixels. Always
specify the width and height of an image – else the web page might flicker
while the image loads. (use the style attribute – it prevents style sheets
from changing the size of images).
Loading large images takes time and can slow down web page.
Use images carefully.
Image Maps
The idea behind an image map is that one should be able to perform different
actions depending on where in the image one clicks.
To create an image map one needs an image and some HTML code that describes
the clickable areas.
The image is inserted using the <img> tag. The only difference from other
images is that one must add the usemap attribute. The usemap value starts
with a hash tag # followed by the name of the image map and is used to
create a relationship between the image and the image map. Any image can be
used as an image map.
<img src="url" alt="text" usemap="#mapname">
The <map> element is used to create an image map and is linked to the image
by using the required name attribute which must have the same value as the
<img> elements usemap attribute.
<map name="mapname"> ... </map>
The values for shape="circle" come as the center coordinates and radius.
<area shape="circle" coords="x, y, radius" href="url" alt="text">
The shape="poly" contains several coordinate points which creates a shape
formed with straight lines (a polygon). This can be used to create any
shape.
Specify the x and y coordinates of all the needed points.
<area shape="poly" coords="x, y, ... " href="url" alt="text">
Specifies the coordinates of the edges of the polygon. If the first and last
coordinate pairs are not the same, the browser will add the last coordinate
pair to close the polygon.
A clickable area can also trigger a JS function. Add a click event to the
<area> element to execute a JS function.
The <area> element can also have the attributes: download="filename",
target="name".
The most common use of the <picture> element will be for art direction in
responsive designs. Instead of having one image that is scaled up or down
based on the viewport width, multiple images can be designed to more nicely
fill the browser viewport.
The <picture> element contains one or more <source> elements each referring
to different images through the srcset attribute. This way the browser can
choose the image that best fits the current view and/or device.
Each <source> element has a media attribute that defines when the image is
the most suitable.
Always specify an <img> element as the last child element of the <picture>
element. The <img> element is used by browsers that do not support the
<picture> element or if none of the <source> tags matches (as a fallback
option).
The media attribute of <source> accepts any valid media query that would
normally be defined in CSS. Possible values are: width, height, device-
width, device-height, aspect-ratio, device-aspect-ratio, color, color-index,
monochrome, resolution, (all these can have min and max prefixes),
orientation(landscape, portrait), scan(progressive, interlace), grid(1, 0).
The devices can be: all, aural, braille, handheld, projection, print,
screen, tty, tv. [Possible operators: and, not, (,). ]
Tables
HTML tables allow web developers to arrange data into rows and columns.
The <td> elements are the data containers of the table. They can contain all
sorts of HTML elements (text, lists, images, tables, so on).
To let the borders collapse into one border, add the CSS border-collapse
property:
border-collapse: collapse
Cell padding specifies the space between the cell content and its borders.
If padding is not specified, the table cells will be displayed without
padding.
Border spacing specifies the space between the cells. To set the border
spacing for a table use CSS border-spacing property.
border-spacing: length
If the table has collapsed borders this property has no effect.
To make a cell span more than one column use the colspan attribute and set
it to a number indicating number of columns to span.
To make a cell span more than one row use the rowspan attribute and set it
to a number indicating number of rows to span.
To add a caption to a table use the <caption> tag. The <caption> tag must be
inserted immediately after the <table> tag.
The <table> tag:
This tag defines an HTML table. An HTML table consists of one <table>
element and one or more <tr>, <th> and <td> elements. An HTML table may also
include <caption>, <colgroup>, <thead>, <tbody>, <tfoot> elements.
To right-align a table: <table style='float:right'>
To center-align a table: <table style='margin-left:auto;margin-right:auto;'>
To add a background color to a table:
<table style='background-color: color'>
To set the table width: <table style='width:75%'>
To set the padding: th, td {padding: 10px;}
The <tr> tag defines a row in an HTML table. A <tr> element contains one or
more <th> or/and <td> elements.
This tag defines a table caption. It must be inserted immediately after the
<table> tag.
This tag specifies a group of one or more columns in a table for formatting.
This tag is useful for applying styles to entire columns, instead of
repeating the styles for each cell, for each row.
This tag must be a child of <table> element after any <caption> element and
before any <tr>, <thead>, <tbody>, <tfoot> elements.
The span attribute with a number value specifies the number of columns a
column group should span.
This tag specifies column properties for each column within a <colgroup>
element. This tag is useful for applying styles to entire columns, instead
of repeating the styles for each cell, for each row.
The span attribute with a number value specifies the number of columns a
<col> element should span.
Browsers can use these elements to enable scrolling of the table body
independently of the header and footer. Also when printing a large table
that spans multiple pages, these elements can enable the table header and
footer to be printed at the top and bottom of each page.
The <thead> element must have one or more <tr> tags inside.
The <thead> tag must be used in the following context: As a child of a
<table> element, after any <caption> and <colgroup> elements, and before any
<tbody>, <tfoot> and <tr> elements.
The <thead>, <tbody>, <tfoot> elements will not affect the layout of the
table by default. Use CSS to style these elements.
HTML lists allow web developers to group a set of related items in lists.
Unordered list
The list items will be marked with bullets (small black circles) by default.
The CSS 'list-style-type' property is used to define the style of the list
item marker.
It can have one of the following values: disc (default), circle, square,
none.
The 'type' attribute can also be used.
HTML lists can be styled in many different ways with CSS. One popular way is
to style a list horizontally, to create a navigation menu.
Ordered list
The 'type' attribute of the <ol> tag defines the type of the list item
marker:
1 (default), A, a, I, i (for numbers, letters and roman numbers).
Also CSS property 'list-style-type' can be used, which offers more types
such as:
decimal, decimal-leading-zero, lower-alpha, upper-alpha, lower-greek, lower-
roman, upper-roman, none, so on.
The 'value' attribute of <li> tag specifies the start value of a list item,
must be a number, and the following list items will increment from that
number. The 'list-style-type' CSS property can also be used with <li> tag.
Description lists
Every HTML element has a default display value, depending on what type of
element it is.
There are to display values: block and inline.
A block-level element always starts on a new line and takes up the full
width available (stretches out to the left and right as far as it can).
An inline element does not start on a new line and it only takes up as much
width as necessary.
An inline element cannot contain a block-level element.
The <div> element is often used as a container for other HTML elements.
It has no required attributes; but style, class, id are common.
When used together with CSS, it can be used to style blocks of content.
The HTML class attribute is used to specify a class for an HTML element.
Multiple HTML elements can share the same class.
<tag class="name">
The class attribute is often used to point to a class name in a style sheet.
It can also be used by JS to access and manipulate elements with the
specific class name.
The class attribute can be used with block and inline elements.
The class attribute can be used on any HTML element.
The class name is case sensitive.
To define the CSS properties for a class, write a dot character followed by
the name of the class and then add the CSS properties, in the format
name:value separated by semicolons, within the curly braces {}: .class
{ ... }.
The class name can also be used by JS to perform certain tasks for specific
elements. JS can access elements with a specific class name with the method
getElementsByClassName().
The id attribute
To define the CSS properties for a given id, write a # character followed by
the value of the id and then add the CSS properties, in the format
name:value separated by semicolons, within the curly braces {}: #id
{ ... }.
HTML bookmarks are used to allow users to jump to specific parts of a web
page. Bookmarks can be useful if the web page is very long. To make a
bookmark, first create the bookmark with the id attribute, and then add a
link to it elsewhere in the page using <a href="#id">.
Iframes
The src attribute specifies the URL of the inline frame page.
Use the height and width attributes to specify the size of the frame.
The height and width are specified in pixels by default. Or use CSS to set
the height and width of the iframe with the style attribute.
Common uses for JS are image manipulation, form validation, and dynamic
changes of content.
To select an HTML element, JS most often uses the document.getElementById()
method.
JS can change HTML content, HTML styles, HTML attributes.
The <noscript> tag is used to provide an alternate content for users that
have disabled scripts in the browser or have a browser that does not support
client-side scripts.
The <head> element is a container for metadata (data about data) and is
placed between the <html> tag and the <body> tag.
HTML metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles,
scripts, and other meta information.
This element defines the title of the document and is required in all HTML
documents.
The title must be text-only.
The contents of a page title is very important for Search Engine
Optimization (SEO) – the page title is used by search engine algorithms to
decide the order when listing pages in search results.
This element:
Defines a title in the browser tab/toolbar
Provides a title for the page when it is bookmarked/added to favorites
Displays a title for the page in search engine results
The name attribute specifies the name for the metadata. It specifies a name
for the information/value of the content attribute. If the http-equiv
attribute is set the name attribute should not be set.
HTML5 introduced a method to take control over the viewport (user visible
area of a page) through the <meta> tag.
The values for name attribute are:
application-name, author, description, generator, keywords, viewport
The value viewport controls the viewport – area visible to a user. The
viewport varies with the device and will be smaller on a mobile phone than
on a computer screen.
Include the following <meta> viewport element in all pages:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
This gives the browser instructions on how to control the page's dimensions
and scaling. The first part sets the width of the page to follow th screen-
width of the device and second part sets the initial zoom level when the
page is first loaded by the browser.
The value description specifies the description of the page. Search engines
can pick up this description to show with the results of searches.
The value author specifies the name of the author of the document.
The value application-name specifies the name of the web application the
page represents.
The content attribute gives the value associated with the name or http-equiv
attribute.
The charset attribute specifies the character encoding for the document.
There can be many <meta> tags defined for a page.
This element specifies the base URL and/or base target for all relative URLs
in a page.
It must have either an href or a target attribute present or both.
There can only be one single <base> element in a document.
<base href="URL" target="_blank| _parent| _self| _top">
HTML has several semantic elements that define the different parts of a web
page:
<header>: defines a header for a document or a section
<nav>: defines a container for navigation links
<section>: defines a section in a document
<article>: defines an independent self-contained article
<aside>: defines content aside from the main content, like a sidebar
<footer>: defines a footer foe a document or a section
<details>: defines additional details
<summary>: defines a heading for the <details> element
There are 4 different techniques to create multicolumn layouts (each has its
pros and cons):
CSS framework
CSS float property
CSS flexbox
CSS grid
Flexbox is a new layout mode in CSS3. Use of flexbox ensures that elements
have predictably when the page layout must accommodate different screen
sizes and different display devices.
The CSS Grid layout module offers a grid-based layout system, with rows and
columns, making it easier to design web pages without having to use floats
and positioning.
Responsive web design is about creating web pages that look good on all
devices.
A responsive web design will automatically adjust for different screen sizes
and viewports.
RWD is about using HTML and CSS to automatically resize, hide, shrink, or
enlarge a website to make it look good on all devices (desktops, tablets,
phones).
To create a responsive website add the below <meta> tag to all pages.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
This will set the viewport of page which will give browser instructions on
how to control the page dimensions and scaling.
Responsive images are images that scale nicely to fit any browser size.
If the CSS width property is set to 100%, the image will be responsive and
scale up and down.
If the max-width property is set to 100%, the image will scale down if it
has to, but never scale up to be larger than its original size.
The <picture> element allows to define different images for different
browser window sizes.
The text size can be set with a "vw" unit (which means the viewport width).
That way the text size will follow the size of the browser window.
Viewport is the browser window size.
1vw = 1% of viewport width
If the viewport is 50cm wide, 1vw = 0.5cm
In addition to resize text and images it is also common to use media queries
in responsive web pages. With media queries one can define completely
different styles for different browser sizes.
HTML contains several elements for defining user input and computer code.
This element represents user input like keyboard input or voice command.
Text surrounded by this element is typically displayed in monospace font.
This element does not preserve extra whitespace and line-breaks. So put the
<code> element inside a <pre> element.
Semantic elements
Semantic elements = elements with a meaning
A semantic element clearly describes its meaning to both the browser and the
developer.
Non-semantic elements tell nothing about the content.
Semantic elements define the content.
In HTML there are semantic elements that can be used to define different
parts of a web page.
Can have several of these elements in a document. Do not place this element
inside <footer>, <address> or another <header>.
There must not be more than one <main> element in a document. It must not be
a descendent of an article, aside, footer, header, nav elements.
This tag defines some content aside form the content it is placed in.
The aside content should be indirectly related to the surrounding content.
The content is often placed as a sidebar in a document.
This tag specifies additional details that the user can open and close on
demand.
This tag is often used to create an interactive widget that the user can
open and close. By default the widget is closed. When open, it expands, and
displays the content within.
Any sort of content can be put inside the <details> tag.
The open attribute, if present, specifies that the details should be
visible/open to the user.
A consistent, clean and tidy HTML code makes it easier to read and
understand.
Always declare the document type as the first line in the document.
The correct document type for HTML is:
<!doctype html>
Always specify the alt attribute for images. This attribute is important if
the image for some reason cannot be displayed.
Always define the width and height of images. This reduces flickering,
because the browser can reserve space for the image before loading.
HTML allows spaces around equal signs. But space-less is easier to read and
groups entities better together.
When using an HTML editor, it is not convenient to scroll right and left to
read the HTML code.
Try to avoid too long code lines.
An HTML page will validate without the <html> and <body> tags.
Always use these tags.
The <html> element is the document root and the recommended place for
specifying the page language. <html>, <head>, <body> are necessary for DOM
and XML parsing.
To ensure proper interpretation and correct search engine indexing both the
language and character encoding should be defined as early as possible in an
HTML document.
Use simple syntax for linking to style sheets, the type attribute is not
necessary. Use rel and href attributes for the link element.
Compress short CSS rules to a single line.
Write long CSS rules on multiple lines with selector and { on first line,
followed by one declaration per line and closing } on last line.
Place the opening { on the same line as the selector and use one space
before {. Use two spaces of indentation for declarations. Use a ; after each
property-value pair including the last. Only use quotes around the values if
it contains spaces. Place the closing } on a new line without leading
spaces.
Use simple syntax for loading external scripts, the type attribute is not
necessary. Use src attribute.
Some web servers (Apache, Unix) are case sensitive about file names. Others
are not (Microsoft, IIS). So always use lowercase file names.
When a URL does not specify a file name at the end, the server just adds a
default file name (index.html, index.htm, default.html, default.htm, so on).
Servers can be configured with more than one default file name.
Entities
Some characters are reserved in HTML. Ig < or > signs are used in text the
browser might mix them with tags. Character entities are used to display
reserved characters in HTML.
An entity name is easy to remember. Browsers may not support all entity
names, but the support for numbers is good.
A non-breaking space is a space that will not break into a new line. Two
words separated by a non-breaking space will stick together (not break into
a new line). This is handy when breaking the words might be disruptive.
Another common use is to prevent browsers from truncating spaces in pages.
To add real spaces in text use the character entity.
The non-breaking hyphen ‑ allows to use a hyphen character that wont
break.
Symbols
There are many mathematical (∏, ∑ ), Greek letters (Α, Β
), and other entities (©, ® ) supported by HTML.
Emojis
UTF-8 (Unicode) covers almost all of the characters and symbols in the
world.
The default character set for HTML5 is UTF-8.
To display an HTML page correctly, a web browser must know the character set
used in the page. This is specified in the <meta> tag.
<meta charset="UTF-8">
Many UTF-8 characters cannot be typed on a keyboard, but they can always be
displayed using numbers, called entity numbers.
Since Emojis are characters they can be copied, displayed and sized like any
other character in HTML.
To display an HTML page correctly a web browser must know which character
set to use.
ASCII was the first character encoding standard (character set), which
defined 128 different alphanumeric characters (numbers 0-9, letters a-zA-Z,
and special characters).
ISO-8859-1 was the default character set for HTML 4, which supported 256
different character codes.
ANSI (Windows-1252) was the original Windows character set. ANSI is
identical to ISO-8859-1 except that ANSI has 32 extra characters.
Because ANSI and ISO-8859-1 were so limited HTML 4 also supported UTF-8.
UTF-8 (Unicode) covers almost all of the characters and symbols in the
world.
To display an HTML page correctly, a web browser must know the character set
used in the page. This is specified in the <meta> tag.
<meta charset="UTF-8">
If a browser detects ISO-8859-1 in a web page, it defaults to ANSI.
Use the CSS @charset rule to specify the character encoding used in a style
sheet: @charset ="UTF-8";
URLs
A URL is another word for a web address.
A URL can be composed of words or an Internal Protocol (IP) address.
scheme: defines the type of Internet service (http, https, ftp, file)
prefix: defines a domain prefix (default for http is www)
domain: defines the Internet domain name
port: defines the port number at the host (default for http is 80)
path: defines a path at the server (if omitted, root directory of the site)
filename: defines the name of a document or resource
URLs can only be sent over the Internet using the ASCII character set. If a
URL contains characters outside the ASCII set, the URL has to be converted.
URL encoding converts non-ASCII characters into a format that can be
transmitted over the Internet.
URL encoding replaces non-ASCII characters with a % followed by hex digits.
URLs cannot contain spaces. URL encoding normally replaces a space with a +
sign or %20.
The browser will encode input according to the character-set used in the
page.
The default character-set in HTML5 is UTF-8.
HTML vs XHTML
XML is a markup language where all documents must be marked up correctly (be
well-formed). XHTML was developed to make HTML more extensible and flexible
to work with other data formats. In addition browsers ignore errors in HTML
pages and try to display the website even if it has some errors in the
markup. So XHTML comes with a much stricter error handling.
<!DOCTYPE> is mandatory.
The xmlns attribute in <html> is mandatory.
<html>, <head>, <title>, <body> are mandatory.
Elements must always be properly nested.
Elements must always be closed, even empty elements as <tag />.
Element names must always be in lowercase.
Attribute names must always be in lowercase.
Attribute values must always be quoted.
Attribute minimization is forbidden, for boolean attributes.
Forms
The <form> element defines a form that is used to collect user input.
<form> form elements </form>
Each input field must have a name attribute to be submitted. If the name
attribute is omitted, the data of that input field will not be sent art all.
The action attribute specifies where to send the form-data when a form is
submitted.
action="URL"
When GET is used the form data will be visible in the address field.
Always use POST if the form data contains sensitive or personal information.
It does not display the form data in the address field.
Appends form-data inside the body of the HTTP request.
It has no size limitations and can be used to send large amounts of data.
Form submissions with POST cannot be bookmarked.
the enctype attribute specifies how the form-data should be encoded when
submitting it to the server. It can be used only if method is POST.
enctype="application/x-www-form-urlencoded| multipart/form-data| text/plain"
The first one is default and all characters are encoded before sent, spaces
are converted to + symbols and special characters are converted to ASCII HEX
values.
In second case no characters are encoded, and this value is required when
using forms that have a file upload control.
In third case spaces are converted to + symbols but no special characters
are encoded.
Form Elements
The for attribute of this tag should be equal to the id attribute of the
<input> element to bind them together.
A label can also be bound to an element by placing the element inside the
<label> element.
<label for="element_id"> label </label>
The <input> element
The name attribute is needed to send the content and the id attribute is
needed for the label.
The rows attribute specifies the visible number of lines in a text area.
The cols attribute specifies the visible width of the teat area.
Bothe are numbers.