کاربر:Zaman/صفحه تمرین2

از ویکی‌کد، دانشنامهٔ برنامه‌نویسی
پرش به ناوبری پرش به جستجو


/////////////////////////////////////////


HTML <!DOCTYPE>

❮ PreviousNext ❯


The HTML Document Type

All HTML documents must start with a <!DOCTYPE> declaration.

The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.

In HTML 5, the declaration is simple:

<!DOCTYPE html>

In older documents (HTML 4 or XHTML), the declaration is more complicated because the declaration must refer to a DTD (Document Type Definition).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

You can read more about document types in the <!DOCTYPE> reference.


Valid HTML Elements in Different DOCTYPES

Tag HTML 5 HTML 4 XHTML
<a> Yes Yes Yes
<abbr> Yes Yes Yes
<acronym> No Yes Yes
<address> Yes Yes Yes
<applet> No Yes No
<area> Yes Yes No
<article> Yes No No
<aside> Yes No No
<audio> Yes No No
<b> Yes Yes Yes
<base> Yes Yes Yes
<basefont> No Yes No
<bdi> Yes No No
<bdo> Yes Yes No
<big> No Yes Yes
<blockquote> Yes Yes Yes
<body> Yes Yes Yes
<br> Yes Yes Yes
<button> Yes Yes Yes
<canvas> Yes No No
<caption> Yes Yes Yes
<center> No Yes No
<cite> Yes Yes Yes
<code> Yes Yes Yes
<col> Yes Yes No
<colgroup> Yes Yes No
<datalist> Yes No No
<dd> Yes Yes Yes
<del> Yes Yes No
<details> Yes No No
<dfn> Yes Yes Yes
<dialog> Yes No No
<dir> No Yes No
<div> Yes Yes Yes
<dl> Yes Yes Yes
<dt> Yes Yes Yes
<em> Yes Yes Yes
<embed> Yes No No
<fieldset> Yes Yes Yes
<figcaption> Yes No No
<figure> Yes No No
<font> No Yes No
<footer> Yes No No
<form> Yes Yes Yes
<frame> No No No
<frameset> No Yes No
<h1> to <h6> Yes Yes Yes
<head> Yes Yes Yes
<header> Yes No No
<hr> Yes Yes Yes
<html> Yes Yes Yes
<i> Yes Yes Yes
<iframe> Yes Yes No
<img> Yes Yes Yes
<input> Yes Yes Yes
<ins> Yes Yes No
<kbd> Yes Yes Yes
<label> Yes Yes Yes
<legend> Yes Yes Yes
<li> Yes Yes Yes
<link> Yes Yes Yes
<main> Yes No No
<map> Yes Yes No
<mark> Yes No No
<meta> Yes Yes Yes
<meter> Yes No No
<nav> Yes No No
<noframes> No Yes No
<noscript> Yes Yes Yes
<object> Yes Yes Yes
<ol> Yes Yes Yes
<optgroup> Yes Yes Yes
<option> Yes Yes Yes
<output> Yes No No
<p> Yes Yes Yes
<param> Yes Yes Yes
<pre> Yes Yes Yes
<progress> Yes No No
<q> Yes Yes Yes
<rp> Yes No No
<rt> Yes No No
<ruby> Yes No No
<s> Yes Yes No
<samp> Yes Yes Yes
<script> Yes Yes Yes
<section> Yes No No
<select> Yes Yes Yes
<small> Yes Yes Yes
<source> Yes No No
<span> Yes Yes Yes
<strike> No Yes No
<strong> Yes Yes Yes
<style> Yes Yes Yes
<sub> Yes Yes Yes
<summary> Yes No No
<sup> Yes Yes Yes
<table> Yes Yes Yes
<tbody> Yes Yes No
<td> Yes Yes Yes
<textarea> Yes Yes Yes
<tfoot> Yes Yes No
<th> Yes Yes Yes
<thead> Yes Yes No
<time> Yes No No
<title> Yes Yes Yes
<tr> Yes Yes Yes
<track> Yes No No
<tt> No Yes Yes
<u> Yes Yes No
<ul> Yes Yes Yes
<var> Yes Yes Yes
<video> Yes No No
<wbr> Yes No No


❮ PreviousNext ❯

/////////////////////////////////////////


HTML URL Encoding Reference

❮ PreviousNext ❯


URL encoding converts characters into a format that can be transmitted over the Internet.


URL - Uniform Resource Locator

Web browsers request pages from web servers by using a URL.

The URL is the address of a web page, like: https://www.w3schools.com.


URL Encoding (Percent Encoding)

URLs can only be sent over the Internet using the ASCII character-set.

Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.

URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.

URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.


Try It Yourself

If you click the "Submit" button below, the browser will URL encode the input before it is sent to the server. A page at the server will display the received input.

Try some other input and click Submit again.


URL Encoding Functions

In JavaScript, PHP, and ASP there are functions that can be used to URL encode a string.

PHP has the rawurlencode() function, and ASP has the Server.URLEncode() function.

In JavaScript you can use the encodeURIComponent() function.

Click the "URL Encode" button to see how the JavaScript function encodes the text.


Note: The JavaScript function encodes space as %20.



ASCII Encoding Reference

Your browser will encode input, according to the character-set used in your page.

The default character-set in HTML5 is UTF-8.

Character From Windows-1252 From UTF-8
space %20 %20
! %21 %21
" %22 %22
# %23 %23
$ %24 %24
% %25 %25
& %26 %26
' %27 %27
( %28 %28
) %29 %29
* %2A %2A
+ %2B %2B
, %2C %2C
- %2D %2D
. %2E %2E
/ %2F %2F
0 %30 %30
1 %31 %31
2 %32 %32
3 %33 %33
4 %34 %34
5 %35 %35
6 %36 %36
7 %37 %37
8 %38 %38
9 %39 %39
: %3A %3A
; %3B %3B
< %3C %3C
= %3D %3D
> %3E %3E
? %3F %3F
@ %40 %40
A %41 %41
B %42 %42
C %43 %43
D %44 %44
E %45 %45
F %46 %46
G %47 %47
H %48 %48
I %49 %49
J %4A %4A
K %4B %4B
L %4C %4C
M %4D %4D
N %4E %4E
O %4F %4F
P %50 %50
Q %51 %51
R %52 %52
S %53 %53
T %54 %54
U %55 %55
V %56 %56
W %57 %57
X %58 %58
Y %59 %59
Z %5A %5A
[ %5B %5B
\ %5C %5C
] %5D %5D
^ %5E %5E
_ %5F %5F
` %60 %60
a %61 %61
b %62 %62
c %63 %63
d %64 %64
e %65 %65
f %66 %66
g %67 %67
h %68 %68
i %69 %69
j %6A %6A
k %6B %6B
l %6C %6C
m %6D %6D
n %6E %6E
o %6F %6F
p %70 %70
q %71 %71
r %72 %72
s %73 %73
t %74 %74
u %75 %75
v %76 %76
w %77 %77
x %78 %78
y %79 %79
z %7A %7A
{ %7B %7B
| %7C %7C
} %7D %7D
~ %7E %7E
%7F %7F
` %80 %E2%82%AC
 %81 %81
%82 %E2%80%9A
ƒ %83 %C6%92
%84 %E2%80%9E
%85 %E2%80%A6
%86 %E2%80%A0
%87 %E2%80%A1
ˆ %88 %CB%86
%89 %E2%80%B0
Š %8A %C5%A0
%8B %E2%80%B9
Π%8C %C5%92
 %8D %C5%8D
Ž %8E %C5%BD
 %8F %8F
 %90 %C2%90
%91 %E2%80%98
%92 %E2%80%99
%93 %E2%80%9C
%94 %E2%80%9D
%95 %E2%80%A2
%96 %E2%80%93
%97 %E2%80%94
˜ %98 %CB%9C
%99 %E2%84
š %9A %C5%A1
%9B %E2%80
œ %9C %C5%93
 %9D %9D
ž %9E %C5%BE
Ÿ %9F %C5%B8
%A0 %C2%A0
¡ %A1 %C2%A1
¢ %A2 %C2%A2
£ %A3 %C2%A3
¤ %A4 %C2%A4
¥ %A5 %C2%A5
¦ %A6 %C2%A6
§ %A7 %C2%A7
¨ %A8 %C2%A8
© %A9 %C2%A9
ª %AA %C2%AA
« %AB %C2%AB
¬ %AC %C2%AC
­ %AD %C2%AD
® %AE %C2%AE
¯ %AF %C2%AF
° %B0 %C2%B0
± %B1 %C2%B1
² %B2 %C2%B2
³ %B3 %C2%B3
´ %B4 %C2%B4
µ %B5 %C2%B5
%B6 %C2%B6
· %B7 %C2%B7
¸ %B8 %C2%B8
¹ %B9 %C2%B9
º %BA %C2%BA
» %BB %C2%BB
¼ %BC %C2%BC
½ %BD %C2%BD
¾ %BE %C2%BE
¿ %BF %C2%BF
À %C0 %C3%80
Á %C1 %C3%81
 %C2 %C3%82
à %C3 %C3%83
Ä %C4 %C3%84
Å %C5 %C3%85
Æ %C6 %C3%86
Ç %C7 %C3%87
È %C8 %C3%88
É %C9 %C3%89
Ê %CA %C3%8A
Ë %CB %C3%8B
Ì %CC %C3%8C
Í %CD %C3%8D
Î %CE %C3%8E
Ï %CF %C3%8F
Ð %D0 %C3%90
Ñ %D1 %C3%91
Ò %D2 %C3%92
Ó %D3 %C3%93
Ô %D4 %C3%94
Õ %D5 %C3%95
Ö %D6 %C3%96
× %D7 %C3%97
Ø %D8 %C3%98
Ù %D9 %C3%99
Ú %DA %C3%9A
Û %DB %C3%9B
Ü %DC %C3%9C
Ý %DD %C3%9D
Þ %DE %C3%9E
ß %DF %C3%9F
à %E0 %C3%A0
á %E1 %C3%A1
â %E2 %C3%A2
ã %E3 %C3%A3
ä %E4 %C3%A4
å %E5 %C3%A5
æ %E6 %C3%A6
ç %E7 %C3%A7
è %E8 %C3%A8
é %E9 %C3%A9
ê %EA %C3%AA
ë %EB %C3%AB
ì %EC %C3%AC
í %ED %C3%AD
î %EE %C3%AE
ï %EF %C3%AF
ð %F0 %C3%B0
ñ %F1 %C3%B1
ò %F2 %C3%B2
ó %F3 %C3%B3
ô %F4 %C3%B4
õ %F5 %C3%B5
ö %F6 %C3%B6
÷ %F7 %C3%B7
ø %F8 %C3%B8
ù %F9 %C3%B9
ú %FA %C3%BA
û %FB %C3%BB
ü %FC %C3%BC
ý %FD %C3%BD
þ %FE %C3%BE
ÿ %FF %C3%BF

URL Encoding Reference

The ASCII control characters %00-%1F were originally designed to control hardware devices.

Control characters have nothing to do inside a URL.

ASCII Character Description URL-encoding
NUL null character %00
SOH start of header %01
STX start of text %02
ETX end of text %03
EOT end of transmission %04
ENQ enquiry %05
ACK acknowledge %06
BEL bell (ring) %07
BS backspace %08
HT horizontal tab %09
LF line feed %0A
VT vertical tab %0B
FF form feed %0C
CR carriage return %0D
SO shift out %0E
SI shift in %0F
DLE data link escape %10
DC1 device control 1 %11
DC2 device control 2 %12
DC3 device control 3 %13
DC4 device control 4 %14
NAK negative acknowledge %15
SYN synchronize %16
ETB end transmission block %17
CAN cancel %18
EM end of medium %19
SUB substitute %1A
ESC escape %1B
FS file separator %1C
GS group separator %1D
RS record separator %1E
US unit separator %1F


❮ PreviousNext ❯

/////////////////////////////////////////


HTML Language Code Reference

❮ PreviousNext ❯


ISO Language Codes

The HTML lang attribute can be used to declare the language of a Web page or a portion of a Web page. This is meant to assist search engines and browsers.

According to the W3C recommendation you should declare the primary language for each Web page with the lang attribute inside the <html> tag, like this:

<html lang="en">

...

</html>

In XHTML, the language is declared inside the <html> tag as follows:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

...

</html>


ISO 639-1 Language Codes

ISO 639-1 defines abbreviations for languages.

In HTML and XHTML they can be used in the lang and xml:lang attributes.

See also: next reference for country codes.

Language ISO Code
Abkhazian ab
Afar aa
Afrikaans af
Akan ak
Albanian sq
Amharic am
Arabic ar
Aragonese an
Armenian hy
Assamese as
Avaric av
Avestan ae
Aymara ay
Azerbaijani az
Bambara bm
Bashkir ba
Basque eu
Belarusian be
Bengali (Bangla) bn
Bihari bh
Bislama bi
Bosnian bs
Breton br
Bulgarian bg
Burmese my
Catalan ca
Chamorro ch
Chechen ce
Chichewa, Chewa, Nyanja ny
Chinese zh
Chinese (Simplified) zh-Hans
Chinese (Traditional) zh-Hant
Chuvash cv
Cornish kw
Corsican co
Cree cr
Croatian hr
Czech cs
Danish da
Divehi, Dhivehi, Maldivian dv
Dutch nl
Dzongkha dz
English en
Esperanto eo
Estonian et
Ewe ee
Faroese fo
Fijian fj
Finnish fi
French fr
Fula, Fulah, Pulaar, Pular ff
Galician gl
Gaelic (Scottish) gd
Gaelic (Manx) gv
Georgian ka
German de
Greek el
Greenlandic kl
Guarani gn
Gujarati gu
Haitian Creole ht
Hausa ha
Hebrew he
Herero hz
Hindi hi
Hiri Motu ho
Hungarian hu
Icelandic is
Ido io
Igbo ig
Indonesian id, in
Interlingua ia
Interlingue ie
Inuktitut iu
Inupiak ik
Irish ga
Italian it
Japanese ja
Javanese jv
Kalaallisut, Greenlandic kl
Kannada kn
Kanuri kr
Kashmiri ks
Kazakh kk
Khmer km
Kikuyu ki
Kinyarwanda (Rwanda) rw
Kirundi rn
Kyrgyz ky
Komi kv
Kongo kg
Korean ko
Kurdish ku
Kwanyama kj
Lao lo
Latin la
Latvian (Lettish) lv
Limburgish ( Limburger) li
Lingala ln
Lithuanian lt
Luga-Katanga lu
Luganda, Ganda lg
Luxembourgish lb
Manx gv
Macedonian mk
Malagasy mg
Malay ms
Malayalam ml
Maltese mt
Maori mi
Marathi mr
Marshallese mh
Moldavian mo
Mongolian mn
Nauru na
Navajo nv
Ndonga ng
Northern Ndebele nd
Nepali ne
Norwegian no
Norwegian bokmål nb
Norwegian nynorsk nn
Nuosu ii
Occitan oc
Ojibwe oj
Old Church Slavonic, Old Bulgarian cu
Oriya or
Oromo (Afaan Oromo) om
Ossetian os
Pāli pi
Pashto, Pushto ps
Persian (Farsi) fa
Polish pl
Portuguese pt
Punjabi (Eastern) pa
Quechua qu
Romansh rm
Romanian ro
Russian ru
Sami se
Samoan sm
Sango sg
Sanskrit sa
Serbian sr
Serbo-Croatian sh
Sesotho st
Setswana tn
Shona sn
Sichuan Yi ii
Sindhi sd
Sinhalese si
Siswati ss
Slovak sk
Slovenian sl
Somali so
Southern Ndebele nr
Spanish es
Sundanese su
Swahili (Kiswahili) sw
Swati ss
Swedish sv
Tagalog tl
Tahitian ty
Tajik tg
Tamil ta
Tatar tt
Telugu te
Thai th
Tibetan bo
Tigrinya ti
Tonga to
Tsonga ts
Turkish tr
Turkmen tk
Twi tw
Uyghur ug
Ukrainian uk
Urdu ur
Uzbek uz
Venda ve
Vietnamese vi
Volapük vo
Wallon wa
Welsh cy
Wolof wo
Western Frisian fy
Xhosa xh
Yiddish yi, ji
Yoruba yo
Zhuang, Chuang za
Zulu zu


❮ PreviousNext ❯

/////////////////////////////////////////


HTML ISO Country Codes Reference

❮ PreviousNext ❯


ISO Country Codes

ISO country codes define abbreviations for countries.

In HTML they can be used as an addition to the language value in the lang attribute.

The first two characters of a language code defines the language. (see previous reference)

The last two defines the country.

... </nowiki>


ISO Country Codes

Country ISO Code
AFGHANISTAN AF
ALBANIA AL
ALGERIA DZ
AMERICAN SAMOA AS
ANDORRA AD
ANGOLA AO
ANTARCTICA AQ
ANTIGUA AND BARBUDA AG
ARGENTINA AR
ARMENIA AM
ARUBA AW
AUSTRALIA AU
AUSTRIA AT
AZERBAIJAN AZ
BAHAMAS BS
BAHRAIN BH
BANGLADESH BD
BARBADOS BB
BELARUS BY
BELGIUM BE
BELIZE BZ
BENIN BJ
BERMUDA BM
BHUTAN BT
BOLIVIA BO
BOSNIA AND HERZEGOVINA BA
BOTSWANA BW
BOUVET ISLAND BV
BRAZIL BR
BRITISH INDIAN OCEAN TERRITORY IO
BRUNEI DARUSSALAM BN
BULGARIA BG
BURKINA FASO BF
BURUNDI BI
CAMBODIA KH
CAMEROON CM
CANADA CA
CAPE VERDE CV
CAYMAN ISLANDS KY
CENTRAL AFRICAN REPUBLIC CF
CHAD TD
CHILE CL
CHINA CN
CHRISTMAS ISLAND CX
COCOS (KEELING) ISLANDS CC
COLOMBIA CO
COMOROS KM
CONGO CG
CONGO, THE DEMOCRATIC REPUBLIC OF THE CD
COOK ISLANDS CK
COSTA RICA CR
CÔTE D'IVOIRE CI
CROATIA HR
CUBA CU
CYPRUS CY
CZECH REPUBLIC CZ
DENMARK DK
DJIBOUTI DJ
DOMINICA DM
DOMINICAN REPUBLIC DO
ECUADOR EC
EGYPT EG
EL SALVADOR SV
EQUATORIAL GUINEA GQ
ERITREA ER
ESTONIA EE
ETHIOPIA ET
FALKLAND ISLANDS (MALVINAS) FK
FAROE ISLANDS FO
FIJI FJ
FINLAND FI
FRANCE FR
FRENCH GUIANA GF
FRENCH POLYNESIA PF
FRENCH SOUTHERN TERRITORIES TF
GABON GA
GAMBIA GM
GEORGIA GE
GERMANY DE
GHANA GH
GIBRALTAR GI
GREECE GR
GREENLAND GL
GRENADA GD
GUADELOUPE GP
GUAM GU
GUATEMALA GT
GUINEA GN
GUINEA-BISSAU GW
GUYANA GY
HAITI HT
HEARD ISLAND AND MCDONALD ISLANDS HM
HONDURAS HN
HONG KONG HK
HUNGARY HU
ICELAND IS
INDIA IN
INDONESIA ID
IRAN, ISLAMIC REPUBLIC OF IR
IRAQ IQ
IRELAND IE
ISRAEL IL
ITALY IT
JAMAICA JM
JAPAN JP
JORDAN JO
KAZAKHSTAN KZ
KENYA KE
KIRIBATI KI
KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KP
KOREA, REPUBLIC OF KR
KUWAIT KW
KYRGYZSTAN KG
LAO PEOPLE'S DEMOCRATIC REPUBLIC (LAOS) LA
LATVIA LV
LEBANON LB
LESOTHO LS
LIBERIA LR
LIBYAN ARAB JAMAHIRIYA LY
LIECHTENSTEIN LI
LITHUANIA LT
LUXEMBOURG LU
MACAO MO
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MK
MADAGASCAR MG
MALAWI MW
MALAYSIA MY
MALDIVES MV
MALI ML
MALTA MT
MARSHALL ISLANDS MH
MARTINIQUE MQ
MAURITANIA MR
MAURITIUS MU
MAYOTTE YT
MEXICO MX
MICRONESIA, FEDERATED STATES OF FM
MOLDOVA, REPUBLIC OF MD
MONACO MC
MONGOLIA MN
MONTENEGRO ME
MONTSERRAT MS
MOROCCO MA
MOZAMBIQUE MZ
MYANMAR MM
NAMIBIA NA
NAURU NR
NEPAL NP
NETHERLANDS NL
NETHERLANDS ANTILLES AN
NEW CALEDONIA NC
NEW ZEALAND NZ
NICARAGUA NI
NIGER NE
NIGERIA NG
NIUE NU
NORFOLK ISLAND NF
NORTHERN MARIANA ISLANDS MP
NORWAY NO
OMAN OM
PAKISTAN PK
PALAU PW
PALESTINIAN TERRITORY, OCCUPIED PS
PANAMA PA
PAPUA NEW GUINEA PG
PARAGUAY PY
PERU PE
PHILIPPINES PH
PITCAIRN PN
POLAND PL
PORTUGAL PT
PUERTO RICO PR
QATAR QA
RÉUNION RE
ROMANIA RO
RUSSIAN FEDERATION RU
RWANDA RW
SAINT HELENA SH
SAINT KITTS AND NEVIS KN
SAINT LUCIA LC
SAINT PIERRE AND MIQUELON PM
SAINT VINCENT AND THE GRENADINES VC
SAMOA WS
SAN MARINO SM
SAO TOME AND PRINCIPE ST
SAUDI ARABIA SA
SENEGAL SN
SERBIA RS
SEYCHELLES SC
SIERRA LEONE SL
SINGAPORE SG
SLOVAKIA SK
SLOVENIA SI
SOLOMON ISLANDS SB
SOMALIA SO
SOUTH AFRICA ZA
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS
SPAIN ES
SRI LANKA LK
SUDAN SD
SURINAME SR
SVALBARD AND JAN MAYEN SJ
SWAZILAND SZ
SWEDEN SE
SWITZERLAND CH
SYRIAN ARAB REPUBLIC SY
TAIWAN TW
TAJIKISTAN TJ
TANZANIA, UNITED REPUBLIC OF TZ
THAILAND TH
TIMOR-LESTE TL
TOGO TG
TOKELAU TK
TONGA TO
TRINIDAD AND TOBAGO TT
TUNISIA TN
TURKEY TR
TURKMENISTAN TM
TURKS AND CAICOS ISLANDS TC
TUVALU TV
UGANDA UG
UKRAINE UA
UNITED ARAB EMIRATES AE
UNITED KINGDOM GB
UNITED STATES US
UNITED STATES MINOR OUTLYING ISLANDS UM
URUGUAY UY
UZBEKISTAN UZ
VANUATU VU
VENEZUELA VE
VIET NAM VN
VIRGIN ISLANDS, BRITISH VG
VIRGIN ISLANDS, U.S. VI
WALLIS AND FUTUNA WF
WESTERN SAHARA EH
YEMEN YE
ZAMBIA ZM
ZIMBABWE ZW


❮ PreviousNext ❯

/////////////////////////////////////////


HTTP Status Messages

❮ PreviousNext ❯


HTML Error Messages

When a browser requests a service from a web server, an error might occur, and the server might return an error code like 404 Not Found.

It is common to name these errors HTML error messages.

But these messages are something called HTTP status messages. In fact, the server always returns a message for every request. The most common message is 200 OK.

Below is a list of HTTP status messages that might be returned:

1xx: Information

Message: Description:
100 Continue The server has received the request headers, and the client should proceed to send the request body
101 Switching Protocols The requester has asked the server to switch protocols
103 Checkpoint Used in the resumable requests proposal to resume aborted PUT or POST requests

2xx: Successful

Message: Description:
200 OK The request is OK (this is the standard response for successful HTTP requests)
201 Created The request has been fulfilled, and a new resource is created
202 Accepted The request has been accepted for processing, but the processing has not been completed
203 Non-Authoritative Information The request has been successfully processed, but is returning information that may be from another source
204 No Content The request has been successfully processed, but is not returning any content
205 Reset Content The request has been successfully processed, but is not returning any content, and requires that the requester reset the document view
206 Partial Content The server is delivering only part of the resource due to a range header sent by the client

3xx: Redirection

Message: Description:
300 Multiple Choices A link list. The user can select a link and go to that location. Maximum five addresses  
301 Moved Permanently The requested page has moved to a new URL
302 Found The requested page has moved temporarily to a new URL
303 See Other The requested page can be found under a different URL
304 Not Modified Indicates the requested page has not been modified since last requested
306 Switch Proxy No longer used
307 Temporary Redirect The requested page has moved temporarily to a new URL
308 Resume Incomplete Used in the resumable requests proposal to resume aborted PUT or POST requests


4xx: Client Error

Message: Description:
400 Bad Request The request cannot be fulfilled due to bad syntax
401 Unauthorized The request was a legal request, but the server is refusing to respond to it. For use when authentication is possible but has failed or not yet been provided
402 Payment Required Reserved for future use
403 Forbidden The request was a legal request, but the server is refusing to respond to it
404 Not Found The requested page could not be found but may be available again in the future
405 Method Not Allowed A request was made of a page using a request method not supported by that page
406 Not Acceptable The server can only generate a response that is not accepted by the client
407 Proxy Authentication Required The client must first authenticate itself with the proxy
408 Request Timeout The server timed out waiting for the request
409 Conflict The request could not be completed because of a conflict in the request
410 Gone The requested page is no longer available
411 Length Required The "Content-Length" is not defined. The server will not accept the request without it
412 Precondition Failed The precondition given in the request evaluated to false by the server
413 Request Entity Too Large The server will not accept the request, because the request entity is too large
414 Request-URI Too Long The server will not accept the request, because the URL is too long. Occurs when you convert a POST request to a GET request with a long query information
415 Unsupported Media Type The server will not accept the request, because the media type is not supported
416 Requested Range Not Satisfiable The client has asked for a portion of the file, but the server cannot supply that portion
417 Expectation Failed The server cannot meet the requirements of the Expect request-header field

5xx: Server Error

Message: Description:
500 Internal Server Error A generic error message, given when no more specific message is suitable
501 Not Implemented The server either does not recognize the request method, or it lacks the ability to fulfill the request
502 Bad Gateway The server was acting as a gateway or proxy and received an invalid response from the upstream server
503 Service Unavailable The server is currently unavailable (overloaded or down)
504 Gateway Timeout The server was acting as a gateway or proxy and did not receive a timely response from the upstream server
505 HTTP Version Not Supported The server does not support the HTTP protocol version used in the request
511 Network Authentication Required The client needs to authenticate to gain network access


❮ PreviousNext ❯

/////////////////////////////////////////


HTTP Request Methods

❮ PreviousNext ❯


The two most common HTTP methods are: GET and POST.


What is HTTP?

The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers.

HTTP works as a request-response protocol between a client and server.

A web browser may be the client, and an application on a computer that hosts a web site may be the server.

Example: A client (browser) submits an HTTP request to the server; then the server returns a response to the client. The response contains status information about the request and may also contain the requested content.


HTTP Methods

  • GET
  • POST
  • PUT
  • HEAD
  • DELETE
  • PATCH
  • OPTIONS

The GET Method

GET is used to request data from a specified resource.

GET is one of the most common HTTP methods.

Note that the query string (name/value pairs) is sent in the URL of a GET request:

/test/demo_form.php?name1=value1&name2=value2

Some other notes on GET requests:

  • GET requests can be cached
  • GET requests remain in the browser history
  • GET requests can be bookmarked
  • GET requests should never be used when dealing with sensitive data
  • GET requests have length restrictions
  • GET requests are only used to request data (not modify)

The POST Method

POST is used to send data to a server to create/update a resource.

The data sent to the server with POST is stored in the request body of the HTTP request:

POST /test/demo_form.php HTTP/1.1

Host: w3schools.com

name1=value1&name2=value2

POST is one of the most common HTTP methods.

Some other notes on POST requests:

  • POST requests are never cached
  • POST requests do not remain in the browser history
  • POST requests cannot be bookmarked
  • POST requests have no restrictions on data length


The PUT Method

PUT is used to send data to a server to create/update a resource.

The difference between POST and PUT is that PUT requests are idempotent. That is, calling the same PUT request multiple times will always produce the same result. In contrast, calling a POST request repeatedly have side effects of creating the same resource multiple times.


The HEAD Method

HEAD is almost identical to GET, but without the response body.

In other words, if GET /users returns a list of users, then HEAD /users will make the same request but will not return the list of users.

HEAD requests are useful for checking what a GET request will return before actually making a GET request - like before downloading a large file or response body.


The DELETE Method

The DELETE method deletes the specified resource.


The OPTIONS Method

The OPTIONS method describes the communication options for the target resource.


Compare GET vs. POST

The following table compares the two HTTP methods: GET and POST.

GET POST
BACK button/Reload Harmless Data will be re-submitted (the browser should alert the user that the data are about to be re-submitted)
Bookmarked Can be bookmarked Cannot be bookmarked
Cached Can be cached Not cached
Encoding type application/x-www-form-urlencoded application/x-www-form-urlencoded or multipart/form-data. Use multipart encoding for binary data
History Parameters remain in browser history Parameters are not saved in browser history
Restrictions on data length Yes, when sending data, the GET method adds the data to the URL; and the length of a URL is limited (maximum URL length is 2048 characters) No restrictions
Restrictions on data type Only ASCII characters allowed No restrictions. Binary data is also allowed
Security GET is less secure compared to POST because data sent is part of the URL


Never use GET when sending passwords or other sensitive information!

POST is a little safer than GET because the parameters are not stored in browser history or in web server logs
Visibility Data is visible to everyone in the URL Data is not displayed in the URL


❮ PreviousNext ❯

/////////////////////////////////////////


Pixels to Ems Conversion

❮ PreviousNext ❯


The tool below allows you to work out the em sizes from pixels (or vice versa).


Pixel to Em Converter

  • Set a default pixel size for body (usually 16px)
  • Then, convert a pixel value to em, based on the default pixel size
  • Or, convert an em value to pixels, based on the default pixel size

Set a default pixel size:

px


Convert PX to EM:

 px

Convert EM to PX:

 em

Convert


Result:


Body Font Size

In the table below, select a body font size in pixels (px) to display a complete "px to em and percent" conversion table.

Tip: The default font size is usually 16px.

px em percent
5px 0.3125em 31.25%
6px 0.3750em 37.50%
7px 0.4375em 43.75%
8px 0.5000em 50.00%
9px 0.5625em 56.25%
10px 0.6250em 62.50%
11px 0.6875em 68.75%
12px 0.7500em 75.00%
13px 0.8125em 81.25%
14px 0.8750em 87.50%
15px 0.9375em 93.75%
16px 1.0000em 100.00%
17px 1.0625em 106.25%
18px 1.1250em 112.50%
19px 1.1875em 118.75%
20px 1.2500em 125.00%
21px 1.3125em 131.25%
22px 1.3750em 137.50%
23px 1.4375em 143.75%
24px 1.5000em 150.00%
25px 1.5625em 156.25%

What is the difference between PX, EM and Percent?

Pixel is a static measurement, while percent and EM are relative measurements. The size of an EM or percent depends on its parent. If the text size of body is 16 pixels, then 150% or 1.5 EM will be 24 pixels (1.5 * 16). Look at CSS Units for more measurement units.


❮ PreviousNext ❯

/////////////////////////////////////////


Keyboard Shortcuts

❮ PreviousNext ❯


Save time by using keyboard shortcuts.


Keyboard Shortcuts For Windows and Mac

Keyboard shortcuts are often used in modern operating systems and computer software programs.

Using keyboard shortcuts could save you a lot of time.


Basic Shortcuts

Description Windows Mac OS
Edit menu Alt + E Ctrl + F2 + F
File menu Alt + F Ctrl + F2 + E
View menu Alt + V Ctrl + F2 + V
Select all text Ctrl + A Cmd + A
Copy text Ctrl + C Cmd + C
Find text Ctrl + F Cmd + F
Find and replace text Ctrl + H Cmd + F
New Document Ctrl + N Cmd + N
Open a file Ctrl + O Cmd + O
Print options Ctrl + P Cmd + P
Save file Ctrl + S Cmd + S
Paste text Ctrl + V Cmd + V
Cut text Ctrl + X Cmd + X
Redo text Ctrl + Y Shift + Cmd + Z
Undo text Ctrl + Z Cmd + Z

Text Editing

Description Windows Mac OS
Cursor Movement
Go to the right or to the beginning of next line break Right Arrow Right Arrow
Go to the left or to the end of previous line break Left Arrow Left Arrow
Go up one row Up Arrow Up Arrow
Go down one row Down Arrow Down Arrow
Go to the beginning of the current line Home Cmd + Left Arrow
Go to the end of the current line End Cmd + Right Arrow
Go to the beginning of the document Ctrl + Home Cmd + Up Arrow
Go to the end of the document Ctrl + End Cmd + Down Arrow
Move up one frame Page Up Fn + Up Arrow
Move down one frame Page Down Fn + Down Arrow
Go to beginning of previous word Ctrl + Left Arrow Option + Left Arrow
Go to beginning of next word Ctrl + Right Arrow Option + Right Arrow
Go to beginning of line break Ctrl + Up Arrow Cmd + Left Arrow
Go to end of line break Ctrl + Down Arrow Cmd + Right Arrow
Text Selection
Select characters to the left Shift + Left Arrow Shift + Left Arrow
Select characters to the right Shift + Right Arrow Shift + Right Arrow
Select lines upwards Shift + Up Arrow Shift + Up Arrow
Select lines downwards Shift + Down Arrow Shift + Down Arrow
Select words to the left Shift + Ctrl + Left Shift + Opt + Left
Select words to the right Shift + Ctrl + Right Shift + Opt + Right
Select paragraphs to the left Shift + Ctrl + Up Shift + Opt + Up
Select paragraphs to the right Shift + Ctrl + Down Shift + Opt + Down
Select text between the cursor and the beginning of the current line Shift + Home Cmd + Shift + Left Arrow
Select text between the cursor and the end of the current line Shift + End Cmd + Shift + Right Arrow
Select text between the cursor and the beginning of the document Shift + Ctrl + Home Cmd + Shift + Up Arrow or Cmd + Shift + Fn + Left Arrow
Select text between the cursor and the end of the document Shift + Ctrl + End Cmd + Shift + Down Arrow or Cmd + Shift + Fn + Right Arrow
Select one frame at a time of text above the cursor Shift + Page Up Shift + Fn + Up Arrow
Select one frame at a time of text below the cursor Shift + Page Down Shift + Fn + Down Arrow
Select all text Ctrl + A Cmd + A
Find text Ctrl + F Cmd + F
Text Formatting
Make selected text bold Ctrl + B Cmd + B
Make selected text italic Ctrl + I Cmd + I
Underline selected text Ctrl + U Cmd + U
Make selected text superscript Ctrl + Shift + = Cmd + Shift + =
Make selected text subscript Ctrl + = Cmd + =
Text Editing
Delete characters to the left Backspace Backspace
Delete characters to the right Delete Fn + Backspace
Delete words to the right Ctrl + Del Cmd + Backspace
Delete words to the left Ctrl + Backspace Cmd + Fn + Backspace
Indent Tab Tab
Outdent Shift + Tab Shift + Tab
Copy text Ctrl + C Cmd + C
Find and replace text Ctrl + H Cmd + F
Paste text Ctrl + V Cmd + V
Cut text Ctrl + X Cmd + X
Redo text Ctrl + Y Shift + Cmd + Z
Undo text Ctrl + Z Cmd + Z


Web Browsers

Description Windows Mac OS
Navigation
Scroll down a frame Space or Page Down Space or Fn + Down Arrow
Scroll up a frame Shift + Space or Page Up Shift + Space or Fn + Up Arrow
Go to bottom of the page End Cmd + Down Arrow
Go to top of the page Home Cmd + Up Arrow
Go back Alt + Left Arrow or Backspace Cmd + Left Arrow
Go forward Alt + Right Arrow or Shift + Backspace Cmd + Right Arrow
Refresh a webpage F5 Cmd + R
Refresh a webpage (no cache) Ctrl + F5 Cmd + Shift + R
Stop Esc Esc
Toggle full-screen F11 Cmd + Shift + F
Zoom in Ctrl + + Cmd + +
Zoom out Ctrl + - Cmd + -
Zoom 100% (default) Ctrl + 0 Cmd + 0
Open homepage Alt + Home Option + Home or Option + Fn + Left Arrow
Find text Ctrl + F Cmd + F
Tab / Window Management
Open a new tab Ctrl + T Cmd + T
Close current tab Ctrl + W Cmd + W
Close all tabs Ctrl + Shift + W Cmd + Q
Close all tabs except the current tab Ctrl + Alt + F4 Cmd + Opt + W
Go to next tab Ctrl + Tab Control + Tab or Cmd + Shift + Right Arrow
Go to previous tab Ctrl + Shift + Tab Shift + Control + Tab or Cmd + Shift + Left Arrow
Go to a specific tab number Ctrl + 1-8 Cmd + 1-8
Go to the last tab Ctrl + 9 Cmd + 9
Reopen the last closed tab Ctrl + Shift + T Cmd + Shift + T
Open a new window Ctrl + N Cmd + N
Close current window Alt + F4 Cmd + W
Go to next window Alt + Tab Cmd + Tab
Go to previous window Alt + Shift + Tab Cmd + Shift + Tab
Reopen the last closed window Ctrl + Shift + N
Open links in a new tab in the background Ctrl + Click Cmd + Click
Open links in a new tab in the foreground Ctrl + Shift + Click Cmd + Shift + Click
Print current webpage Ctrl + P Cmd + P
Save current webpage Ctrl + S Cmd + S
Address Bar
Cycle between toolbar, search bar, and page elements Tab Tab
Go to browser's address bar Ctrl + L or Alt + D Cmd + L
Focus and select the browser's search bar Ctrl + E Cmd + E / Cmd + K
Open the address bar location in a new tab Alt + Enter Opt + Enter
Display a list of previously typed addresses F4
Add "www." to the beginning and ".com" to the end of the text typed in the address bar (e.g., type "w3schools" and press Ctrl + Enter to open "www.w3schools.com") Ctrl + Enter Cmd + Enter or Control + Enter
Bookmarks
Open the bookmarks menu Ctrl + B Cmd + B
Add bookmark for current page Ctrl + D Cmd + Opt + B or Cmd + Shift + B
Open browsing history Ctrl + H Cmd + Shift + H or Cmd + Y
Open download history Ctrl + J Cmd + J or Cmd + Shift + J

Screenshots

Description Windows Mac OS
Save screenshot of the whole screen as file Cmd + Shift + 3
Copy screenshot of the whole screen to the clipboard PrtScr (Print Screen) or Ctrl + PrtScr Cmd + Ctrl + Shift + 3
Save screenshot of window as file Cmd + Shift + 4, then Space
Copy screenshot of window to the clipboard Alt + PrtScr Cmd + Ctrl + Shift + 4, then Space
Copy screenshot of wanted area to the clipboard Cmd + Ctrl + Shift + 4
Save screenshot of wanted area as file Cmd + Shift + 4

Note: Due to different keyboard setups, some shortcuts may not be compatible for all users.


❮ PreviousNext ❯

/////////////////////////////////////////


Pixels to Ems Conversion

❮ PreviousNext ❯


The tool below allows you to work out the em sizes from pixels (or vice versa).


Pixel to Em Converter

  • Set a default pixel size for body (usually 16px)
  • Then, convert a pixel value to em, based on the default pixel size
  • Or, convert an em value to pixels, based on the default pixel size

Set a default pixel size:

px


Convert PX to EM:

 px

Convert EM to PX:

 em

Convert


Result:


Body Font Size

In the table below, select a body font size in pixels (px) to display a complete "px to em and percent" conversion table.

Tip: The default font size is usually 16px.

px em percent
5px 0.3125em 31.25%
6px 0.3750em 37.50%
7px 0.4375em 43.75%
8px 0.5000em 50.00%
9px 0.5625em 56.25%
10px 0.6250em 62.50%
11px 0.6875em 68.75%
12px 0.7500em 75.00%
13px 0.8125em 81.25%
14px 0.8750em 87.50%
15px 0.9375em 93.75%
16px 1.0000em 100.00%
17px 1.0625em 106.25%
18px 1.1250em 112.50%
19px 1.1875em 118.75%
20px 1.2500em 125.00%
21px 1.3125em 131.25%
22px 1.3750em 137.50%
23px 1.4375em 143.75%
24px 1.5000em 150.00%
25px 1.5625em 156.25%

What is the difference between PX, EM and Percent?

Pixel is a static measurement, while percent and EM are relative measurements. The size of an EM or percent depends on its parent. If the text size of body is 16 pixels, then 150% or 1.5 EM will be 24 pixels (1.5 * 16). Look at CSS Units for more measurement units.


❮ PreviousNext ❯