其实这个问题早就发现了,我看了孟子E章和CSDN的相关页面,.net页面执行后html代码也是这样,在此请教高手怎么才能保证自己编辑的Html格式不被打乱?!本身的格式:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://a9.com/-/spec/opensearch/1.1/"><title>
【孟宪会之精彩世界】之.NET开发者园地
</title><meta http-equiv="content-type" content="text/html; charset=gb2312" /><link href="Images/favicon.ico" rel="Shortcut Icon" /><link href="Detail.css" type="text/css" rel="stylesheet" /><link rel="alternate" type="application/rss+xml" title="【孟宪会之精彩世界】" href="http://dotnet.aspx.cc/Rss.aspx" /><link rel="search" type="application/opensearchdescription+xml" title="【孟宪会之精彩世界】网站搜索" href="http://dotnet.aspx.cc/search.xml" /><link rel="search" type="application/opensearchdescription+xml" title="【孟宪会之精彩世界】Google搜索" href="http://dotnet.aspx.cc/searchgoogle.xml" /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
巨人网络集团有限公司 - 职位列表 - 人才频道 - CSDN.NET
</title><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="zh-CN" http-equiv="Content-Language"><meta content="Csdn" name="author"><meta content="Csdn" name="Copyright"><meta content="Csdn" name="description"><meta content="Csdn人才频道" name="keywords">    <script src="/ScriptLibrary/mz/jsframework.js" type="text/javascript"></script>    <link href="/AppThemes/Styles/content.css" rel="stylesheet" type="text/css" /><link href="/AppThemes/Styles/public.css" rel="stylesheet" type="text/css" /><link rel="stylesheet" href="/AppThemes/Styles/Allfoot.css" type="text/css" media="all" /></head>

解决方案 »

  1.   

    我的意思是执行后页面html格式为:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://a9.com/-/spec/opensearch/1.1/">
    <title>【孟宪会之精彩世界】之.NET开发者园地</title>
    <meta http-equiv="content-type" content="text/html; charset=gb2312" />
    <link href="Images/favicon.ico" rel="Shortcut Icon" />
    <link href="Detail.css" type="text/css" rel="stylesheet" />
    <link rel="alternate" type="application/rss+xml" title="【孟宪会之精彩世界】" href="http://dotnet.aspx.cc/Rss.aspx" />
    <link rel="search" type="application/opensearchdescription+xml" title="【孟宪会之精彩世界】网站搜索" href="http://dotnet.aspx.cc/search.xml" />
    <link rel="search" type="application/opensearchdescription+xml" title="【孟宪会之精彩世界】Google搜索" href="http://dotnet.aspx.cc/searchgoogle.xml" /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>巨人网络集团有限公司 - 职位列表 - 人才频道 - CSDN.NET</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="zh-CN" http-equiv="Content-Language">
    <meta content="Csdn" name="author">
    <meta content="Csdn" name="Copyright">
    <meta content="Csdn" name="description">
    <meta content="Csdn人才频道" name="keywords">
    <script src="/ScriptLibrary/mz/jsframework.js" type="text/javascript"></script>
    <link href="/AppThemes/Styles/content.css" rel="stylesheet" type="text/css" />
    <link href="/AppThemes/Styles/public.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/AppThemes/Styles/Allfoot.css" type="text/css" media="all" />
    </head>
      

  2.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">是vs和DW等编辑器自动生成的。<meta http-equiv="content-type" content="text/html; charset=gb2312" />
    <link href="Images/favicon.ico" rel="Shortcut Icon" />等等是手动添加上去的。
      

  3.   

    html输出不是给眼睛看的,iis甚至有对输出的html进行压缩功能,如果把150K的html压缩为10K下载是很爽的事。如果你要看html,应该使用web开发工具将网页源码另存出去,然后格式化。