HTML Kode (Teckenrækkefølge)

For at vise HTML-sider korrekt, skal webbrowseren vide, hvilket tegnsæt der skal bruges.

Fra ASCII til UTF-8

ASCII er den første tegncodestandard. ASCII definerer 128 tegn, der kan bruges på internettet: tal (0-9), bogstaver (A-Z) og nogle specialtegn, såsom: ! $ + - ( ) @ < >.

ISO-8859-1 er standardtegnsæt for HTML 4. Dette tegnsæt understøtter 256 forskellige tegncoder. HTML 4 understøtter også UTF-8.

ANSI (Windows-1252) er den oprindelige Windows-tegnsæt. ANSI er samme som ISO-8859-1, men med 32 ekstra tegn.

HTML5-standarden opfordrer webudviklere til at bruge UTF-8-tegnsæt, som dækker næsten alle tegn og symboler i verden!

HTML charset-attribut

For at vise HTML-sider korrekt, skal webbrowseren vide, hvilket tegnsæt der bruges på siden.

Dette <meta> angivet i tagget:

<meta charset="UTF-8">

Prøv det selv

Forskelle mellem tegnsæt

Følgende tabel viser forskellen mellem de nævnte tegnsæt:

Tal ASCII ANSI 8859 UTF-8 Beskrivelse
32 mellemrum
33!!!!udtrykstegn
34""""citattegn
35####numbertegn
36$$$$dollartegn
37%%%%procenttegn
38&&&&ampersand
3938383838&
ampersand39393939'
apostrophe40404040(
left parenthesis41414141)
right parenthesis****asterisk
+plus signplus signplus signplus sign,
comma45454545-
hyphen-minus....full stop
47////solidus
480000digit zero
491111digit one
502222digit two
513333digit three
524444digit four
535555digit five
546666digit six
557777digit seven
568888digit eight
579999digit nine
58::::colon
59;;;;semicolon
60<<<<less-than sign
61====equals sign
62>>>>greater-than sign
63????question mark
64@@@@commercial at
65AAAALatin capital letter A
66BBBBLatin capital letter B
67CCCCLatin capital letter C
68DDDDLatin capital letter D
69EEEELatin capital letter E
70FFFFLatin capital letter F
71GGGGLatin capital letter G
72HHHHLatin capital letter H
73IIIILatin capital letter I
74JJJJLatin capital letter J
75KKKKLatin capital letter K
76LLLLLatin capital letter L
77MMMMLatin capital letter M
78NNNNLatin capital letter N
79OOOOLatin capital letter O
Latin capital letter MNNNNLatin capital letter N
OLatin capital letter OLatin capital letter OLatin capital letter OLatin capital letter O80
PLatin capital letter PLatin capital letter PLatin capital letter PLatin capital letter P81
QLatin capital letter QLatin capital letter QLatin capital letter QLatin capital letter Q82
RLatin capital letter RLatin capital letter RLatin capital letter RLatin capital letter R83
SLatin capital letter SLatin capital letter SLatin capital letter SLatin capital letter S84
TLatin capital letter TLatin capital letter TLatin capital letter TLatin capital letter T85
ULatin capital letter ULatin capital letter ULatin capital letter ULatin capital letter U86
VLatin capital letter VLatin capital letter VLatin capital letter VLatin capital letter V87
WLatin capital letter WLatin capital letter WLatin capital letter WLatin capital letter W88
XLatin capital letter XLatin capital letter XLatin capital letter XLatin capital letter X89
YLatin capital letter YLatin capital letter YLatin capital letter YLatin capital letter Y90
ZLatin capital letter ZLatin capital letter ZLatin capital letter ZLatin capital letter Z91
[left square bracketleft square bracketleft square bracketleft square bracket\
reverse solidus]]]]right square bracket
^circumflex accentcircumflex accentcircumflex accentcircumflex accent_
low line````grave accent
97aaaaLatin small letter a
98bbbbLatin small letter b
99ccccLatin small letter c
100ddddLatin small letter d
101eeeeLatin small letter e
102ffffLatin small letter f
103ggggLatin small letter g
104hhhhLatin small letter h
105iiiiLatin small letter i
106jjjjLatin small letter j
107kkkkLatin small letter k
108llllLatin small letter l
109mmmmLatin small letter m
110nnnnLatin small letter n
111ooooLatin small letter o
112ppppLatin small letter p
113qqqqLatin small letter q
´rrrrLatin small letter r
´ssssLatin small letter s
´ttttLatin small letter t
´uuuuLatin small letter u
´vvvvLatin small letter v
´wwwwLatin small letter w
´xxxxLatin small letter x
´yyyyLatin small letter y
´zzzzLatin small letter z
´{{{{left curly bracket
´||||vertical line
´}}}}right curly bracket
126´´´´tilde
´DEL    
128 ´  euro sign
´ 129129129157
´ 130  ´
single low-9 quotation mark 131  ´
Latin small letter f with hook 132  ´
double low-9 quotation mark ...  horizontal ellipsis
134 ´  dagger
135 ´  double dagger
136 ´  modifier letter circumflex accent
137 ´  per mille sign
138 ´  Latin capital letter S with caron
139 ´  single left-pointing angle quotation mark
140 ´  Latin capital ligature OE
141 ´´´157
142 ´  Latin capital letter Z with caron
143 ´´´157
144 ´´´157
145 '  '
146 '  '
147 "  "
148 "  returndeletning
149   149
• bullet  150
– en dash  151
— em dash  152
˜ small tilde  153
™ trade mark sign  154
š Latin small letter s with caron  155
› single right-pointing angle quotation mark  156
œ Latin small ligature oeLatin small ligature oeLatin small ligature oe157
 NOT USED  158
ž Latin small letter z with caron  159
Ÿ    Latin capital letter Y with diaeresis
160 no-break spaceno-break spaceno-break space161
¡ inverted exclamation markinverted exclamation markinverted exclamation mark162
¢ cent signcent signcent sign163
£ pound signpound signpound sign164
¤ currency signcurrency signcurrency sign¥
yen sign 166166166¦
broken bar 167167167§
section sign 168168168¨
diaeresis 169169169©
copyright sign 170170170ª
feminine ordinal indicator 171171171«
left-pointing double angle quotation mark 172172172¬
not sign ­­­soft hyphen
174 ®®®registered sign
175 ¯¯¯macron
176 °°°degree sign
177 ±±±plus-minus sign
178 ²²²superscript two
179 ³³³superscript three
180 ´´´acute accent
181 µµµmicro sign
182 pilcrow sign
183 ···middle dot
184 ¸¸¸cedilla
185 ¹¹¹superscript one
186 ºººmasculine ordinal indicator
187 »»»right-pointing double angle quotation mark
188 ¼¼¼vulgar fraction one quarter
189 ½½½vulgar fraction one half
190 ¾¾¾vulgar fraction three quarters
191 ¿¿¿inverted question mark
192 ÀÀÀLatin capital letter A with grave
193 ÁÁÁLatin capital letter A with acute
194 ÂÂÂLatin capital letter A with circumflex
195 ÃÃÃLatin capital letter A with tilde
196 ÄÄÄLatin capital letter A with diaeresis
197 ÅÅÅLatin capital letter A with ring above
198 ÆÆÆLatin capital letter AE
199 ÇÇÇLatin capital letter C with cedilla
200 ÈÈÈLatin capital letter E with grave
201 ÉÉÉLatin capital letter E with acute
202 ÊÊÊLatin capital letter E with circumflex
203 ËËËLatin capital letter E with diaeresis
204 ÌÌÌLatin capital letter I with grave
205 ÍÍÍLatin capital letter I with acute
206 ÎÎÎLatin capital letter I with circumflex
207 ÏÏÏLatin capital letter I with diaeresis
208 ÐÐÐLatin capital letter Eth
209 ÑÑÑLatin capital letter N with tilde
210 ÒÒÒLatin capital letter O with grave
211 ÓÓÓLatin capital letter O with acute
212 ÔÔÔLatin capital letter O with circumflex
213 ÕÕÕLatin capital letter O with tilde
214 ÖÖÖLatin capital letter O with diaeresis
215 ×××multiplication sign
216 ØØØLatin capital letter O with stroke
217 ÙÙÙLatin capital letter U with grave
218 ÚÚÚLatin capital letter U with acute
219 ÛÛÛLatin capital letter U with circumflex
220 ÜÜÜLatin capital letter U with diaeresis
221 ÝÝÝLatin capital letter Y with acute
222 ÞÞÞLatin capital letter Thorn
223 ßßßLatin small letter sharp s
224 àààLatin small letter a with grave
225 áááLatin small letter a with acute
226 âââLatin small letter a with circumflex
227 ãããLatin small letter a with tilde
228 äääLatin small letter a with diaeresis
229 åååLatin small letter a with ring above
230 æææLatin small letter ae
231 çççLatin small letter c with cedilla
232 èèèLatin small letter e with grave
233 éééLatin lille bogstav e med akut
234 êêêLatin lille bogstav e med cirkumflex
235 ëëëLatin lille bogstav e med diaeresis
236 ìììLatin lille bogstav i med grav
237 íííLatin lille bogstav i med akut
238 îîîLatin lille bogstav i med cirkumflex
239 ïïïLatin lille bogstav i med diaeresis
240 ðððLatin lille bogstav eth
241 ñññLatin lille bogstav n med tilde
242 òòòLatin lille bogstav o med grav
243 óóóLatin lille bogstav o med akut
244 ôôôLatin lille bogstav o med cirkumflex
245 õõõLatin lille bogstav o med tilde
246 öööLatin lille bogstav o med diaeresis
247 ÷÷÷divisionssign
248 øøøLatin lille bogstav o med streg
249 ùùùLatin lille bogstav u med grav
250 úúúLatin lille bogstav u med akut
251 ûûûLatin lille bogstav med cirkumflex
252 üüüLatin lille bogstav u med diaeresis
253 ýýýLatin lille bogstav y med akut
254 þþþLatin lille bogstav thorn
255 ÿÿÿLatin lille bogstav y med diaeresis

ASCII tegnsæt

ASCII bruger værdier mellem 0 og 31 (og 127) som kontrolsignaler.

ASCII uses values from 32 to 126 to represent letters, numbers, and symbols.

ASCII does not use values between 128 and 255.

ANSI character set (Windows-1252)

For values between 0 and 127, ANSI is the same as ASCII.

ANSI has a set of proprietary characters with values from 128 to 159.

For values from 160 to 255, ANSI is the same as UTF-8.

ISO-8859-1 character set

For values between 0 and 127, 8859-1 is the same as ASCII.

8859-1 does not use values between 128 and 159.

For values from 160 to 255, 8859-1 is the same as UTF-8.

UTF-8 character set

For values between 0 and 127, UTF-8 is the same as ASCII.

UTF-8 does not use values between 128 and 159.

For values between 160 and 255, UTF-8 is the same as ANSI and 8859-1.

UTF-8 continues from value 256, including more than 10,000 different characters.

For more in-depth information, please read our complete HTML character set reference manual.

@charset CSS rule

You can use the CSS @charset rule to specify the character encoding used in the stylesheet:

Example

Set the encoding of the stylesheet to Unicode UTF-8:

@charset "UTF-8";

Please find more information about it in our CSS reference manual CSS @charset rule content.