Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have linked my HTML code here. Why is it that when I open this file (locally) on my computer, some special characters will not show. For example, imagine I wrote this code:

nwqidn wqindiwq dwqin <wiqndiw

When opened, the browser will not display the last line of gibberish (anything after and including the less-than symbol). I understand that the browser might have some confusion about when to end the tag, but surely the google browser is advanced enough to know the difference between the closing p tag and a random "<" symbol. I know that I can use the Unicode for "<" and it will display, but I'm trying to find a different solution. Is there any special something that I can put (maybe as metadata?) in my HTML file in order to solve this issue? Thanks in advance for any help.

Here's my entire code of the page below:

<!DOCTYPE html>
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8">

<title>Test</title>
</head>


<body>
<p> dniqwn qwnid wqudn <inwqd </p>

</body>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
338 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use &lt; for 'less than' and &gt; for 'greater than' to insert < and > into html.

Otherwise, as you say, the browser will think you're opening a tag.

<!DOCTYPE html>
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8">

<title>Test</title>
</head>


<body>
<p> dniqwn qwnid wqudn &lt;inwqd </p>

</body>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...