我正在使用placerholder=""来向用户显示他们必须翻译的单词: <input id="ha_1" placeholder="안녕하세요" type="text">韩语单词안녕하세요在chrome中显示完美,但却被搞砸了Firefox和Edge(两者都是最新版本)。 它看起来像这样:
有没有办法直接解决这个问题,还是有解决方法?
I am using placerholder="" like this to show the users which word they have to translate: <input id="ha_1" placeholder="안녕하세요" type="text"> The Korean word 안녕하세요 displays perfectly in chrome, but gets messed up by Firefox and Edge (both newest version). It looks like this:
Any way to fix this directly or is there a workaround for that?
最满意答案
您必须在html代码中定义Character Encoding类型。
什么是字符编码?
ASCII是第一个字符编码标准(也称为字符集)。 ASCII定义了可在互联网上使用的127种不同的字母数字字符:数字(0-9),英文字母(AZ)和一些特殊字符,如! $ + - ()@ <>。
ANSI(Windows-1252)是原始的Windows字符集,支持256种不同的字符代码。
ISO-8859-1是HTML 4的默认字符集。此字符集还支持256种不同的字符代码。
由于ANSI和ISO-8859-1非常有限,因此默认字符编码在HTML5中更改为UTF-8。
UTF-8(Unicode)几乎涵盖了世界上所有的字符和符号。
有关更多信息,请参阅此处
请在<head>标记内使用以下元标记。
<meta charset="UTF-8">
完整的例子。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Character Encoding</title> </head> <body> <h1>안녕하세요</h1> <input id="ha_1" placeholder="안녕하세요" type="text"> </body> </html>You have to define Character Encoding type inside of your html code.
What is Character Encoding?
ASCII was the first character encoding standard (also called character set). ASCII defined 127 different alphanumeric characters that could be used on the internet: numbers (0-9), English letters (A-Z), and some special characters like ! $ + - ( ) @ < > .
ANSI (Windows-1252) was the original Windows character set, with support for 256 different character codes.
ISO-8859-1 was the default character set for HTML 4. This character set also supported 256 different character codes.
Because ANSI and ISO-8859-1 were so limited, the default character encoding was changed to UTF-8 in HTML5.
UTF-8 (Unicode) covers almost all of the characters and symbols in the world.
for more information refer here.
Please use as following meta tag inside of your <head> tag.
<meta charset="UTF-8">
complete example.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Character Encoding</title> </head> <body> <h1>안녕하세요</h1> <input id="ha_1" placeholder="안녕하세요" type="text"> </body> </html>
更多推荐
发布评论