Data Types
A data type is a storage format that stores a specific type or range of value. Some of the data types that are used in programming language are int,decimal string etc.
In html, a data type is defines as the type of data that is used in the content of an element or in the value of attribute.
Basic HTML Data Types:
A data type is a storage format that stores a specific type or range of value. Some of the data types that are used in programming language are int,decimal string etc.
In html, a data type is defines as the type of data that is used in the content of an element or in the value of attribute.
Basic HTML Data Types:
- Character data type: stores single alphanumeric text, which include letters, numbers, symbols, space, or punctuation.
- Text data type: stores a string with a maximum length of 2,147,483,647 printable characters.
- Name data type: refer to name given to any particular data, function or unit of program in a programming language.
- Number data type: refers to the data type that can store a number in the range of 1E-323 to 1.79E+308(positive or negative) with an accuracy of about 15 digits. Arithmetical operations can be performed with number data types.
Data Types defined by the RFC and IANA
RFC is a memorandum that describes the methods, behaviors, or research on the working of internet.
IANA is the entity that looks over the global IP address allocation, media types, and the other internet protocol related assignments.
According to the RFC and IANA documentation, following are the four basic data types:
- Uniform Resource Identifier
- Content type
- Language code
- Character set
It is a set of characters used to identify or name a resource on the internet.
Content Type
Also knows as mime represents types of content used in an embedded or linked resource.
example of content type
- text/plain: represents a plain text.
- image/jpeg: represents a compressed image file.
- audio/basis: represents an audio file.
- video/mpeg: represents a transmitted compressed media file.
- application/octet-stream: represents a binary file
Language Code
It is used to represent the code of various literal languages, which are used to script the HTML document.
Some of the Language codes are:
- English: en
- Hindi: hi
- German: de
- Irish: ga
It is a set of characters taken from several languages and scripts of the world, and are represented with unique code points.
example include dollar sign, lowercase letters, upper case letters, omega etc.
Data Types defined by W3C Specifications
W3C is an international community that develops standards to ensure long term growth of the web.
W3C specifies 5 additional data types for html.
- Date Time
- Red Green Blue triplet
- Color Names
- Link Types
- Media Types
Character Entities
Special character such as < > in html document are knows as entities. Html enables you to include such symbol using character entities.
format of character entity is
- Ampersand (&)
- Name of the entity
- A terminating semicolon
- < : <
- >: >
- &: &
- ": "
- ': '
This is used to draw horizontal line across the browser window. The HR element is used to represent the horizontal rule.
Line Breaks
Used to insert line breaks in an html document.
ex:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML Elements</title>
</head>
<body>
<div>
<h1>Heading 1</h1>
<h1>Heading 2</h1>
<hr />
<p>This is Paragraph</p>
<br />
<a href="http://webtechomaster.blogspot.com">click here</a>
<hr />
<pre>this is
pre-formatted
text
</pre>
</div>
</body>
</html>
used to create paragraph on html document. <p> element is used to create paragraph.
Citations
It displays text in italic format. It is used to Quote statement or remark author.
Quotation
The quotation element is used to quote certain text within the quotation mark. It is represented by Q element.
Definition
It is used to list the definition of various terms. It contains following tags
- DL: represents a definition list
- DT: represents terms in the definition
- DD: represents definition of the terms
It is used to insert comment in the code document. we can use comment to describe the purpose of code which is helpful when you need to make a change in the code.
the commented code is never executed.
syntax of comment is
<!-- this is comment -->
Ex:
0 comments:
Post a Comment