When my page is loaded from the server, source code differs from inspect element by changing the tags positions.
Here how the code looks in the view-source page
<!DOCTYPE html>
<html dir="rtl">
<head>
<link rel="stylesheet" type="text/css" href="css/mainclasses.css">
<title>title </title>
</head>
<body style="margin:0px;">
<div id="wrapper" style="margin:0px auto;">
but when I inspect elements all the tags inside the head
tag goes under the body tag, and two double quotations appear under the body
tag.
<!DOCTYPE html>
<html dir="rtl">
<head></head>
<body style="margin:0px;">
""
<link rel="stylesheet" type="text/css" href="css/mainclasses.css">
<title>title </title>
<div id="wrapper" style="margin:0px auto;">
The page works perfectly and all css properties appears and the title also appears.But I also want the HTML code to be good.
I searched for this and found many things that may cause this problem and none of them helped me.
UTF8 BOM
encoding, all files are UTF8 without BOM
.so the strange chars are not due to file encoding.Break on
, and I can't edit it as HTML.What would be the cause of this problem, and how can I solve it?
I solved my problem.
I checked my HTML code. there were a symbol somewhere inside the head
tag. I deleted the symbol and the HTML code in developer tool was corrected.