昨天我调完页面样式后添加了从后台管理更改title/description/keyword功能,
然后预览就发现页面全部走样,很难调回来
有没有哪位高手能想个办法帮我解决下?万分感谢!!!

解决方案 »

  1.   

    预览就走样?是不是预览时页面没有引用CSS,还是CSS引用的路径不对?看预览时的页面生成的源代码有无CSS或CSS的引用?
      

  2.   

    所有页面全部走样 
    我先贴一个页面的<%@ Page Language="C#" AutoEventWireup="true" CodeFile="productList.aspx.cs" Inherits="productList" %><!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 id="Head1" runat="server">
        <title><%=title %></title>
        <link href="CSS/StyleSheet.css" rel="Stylesheet" type="text/css" />
       <style type="text/css">#advertising{
    position:relative; 
    display:block; 
    background-color:#DFDFDF; 
    text-align:center;
    font-size:12px;
    color:#414141;
    }
    #advertising a{
    font-size:12px; 
    color:#414141; 
    text-decoration:none;
    }#advertising a:hover{
    font-size:12px;
    color:red;
    text-decoration:none;
    }
    #leftmenu{
    display:block; 
    position:relative;
    height:600px;
    width:212px;
    text-align:center;
    background-image:url('images/leftbg.jpg');
    background-repeat:no-repeat;
    vertical-align:top;
    margin-top:-22px;
    border-top:2px #C0C0C0 solid;
    margin-left:10px;
    }
    #navigation{
    background-color:#2697e7;
    font-size:16px;
    font-family:"宋体";
    color:#FFFFFF;
    height:26px;
        padding-top:7px;
    position:relative; 
    display:block;
    width:100%;
    margin-top:-3px;
    font-weight:bold;
    }
    a{
    text-decoration:none;
    color:#FFFFFF;
    font-family:"宋体";
    font-size:16px;
    padding-bottom:5px;

    }
    a:hover{
    text-decoration:none;
    color:red;
    font-family:"宋体";
    font-size:16px;}
    .a
    {
        text-decoration:none;
    color:#FFFFFF;
    font-family:"宋体";
    font-size:12px;
    padding-bottom:5px;
    }
    .a:hover
    {
        text-decoration:none;
    color:red;
    font-family:"宋体";
    font-size:12px;
    padding-bottom:5px;
    }
    #menu
    {
    text-align:center;
    width:160px;
    display:block;
    vertical-align:top;
    position:relative;
    padding-top:20px;
    background-image:url(images/left_bg_pro.jpg);
    background-repeat:no-repeat;
    height:350px;
    /*- margin-left:-10px;*/
    }
    #menu a{
    text-decoration:none;
    color:#064686;
    font-family:"宋体";
    font-size:15px;
    }
    #menu a:hover{
    text-decoration:none;
    color:red;
    font-family:"宋体";
    font-size:15px;
    }
    .border1
    {
    border-top:1px solid #689EC7; 
    font-size:0px;
    line-height:0px; 
    height:0px;
    margin:0px 2px 0px 2px;
    width:150px;
    position:relative;
    text-align:center;
    padding-left:15px;

    }
    .border2
    {
    border:1px solid #689EC7; 
    border-width:0px 1px 0px 1px;
    margin:0px 1px 0px 1px; 
    font-size:0px;
    line-height:0px; 
    height:1px;
    width:150px;
    position:relative;
    text-align:center;
    padding-left:15px;
    }
    #main
    {
    display:block;
    filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorStr=#FFFFFF,endColorStr=#E6E4E9);
    border:1px #92B7D4 solid;
    border-width:0px 1px 0px 1px;
    overflow:hidden;
    position:relative;
    width:150px;
    text-align:center;
    padding-left:15px;
    }
    .td
    {
    border-bottom:1px #D6D6D6 dashed;
    font-family:宋体;
    font-size:16px;
    }
    #info
    {
    display:inline;
    width:800;
    background-color:White;
    border-width:0px 1px 0px 1px;
    overflow:hidden;
    height:600;
    position:relative;
    vertical-align:top;
    background-image:url('images/right_bg.jpg');
    background-repeat:no-repeat;
    text-align:left;
    padding-left:10px;
    margin-top:0px;
    padding-top:10px;
    z-index:1;
    }
    #tab
    {
    position:absolute;
    background-image:url('images/tab.jpg');
    background-repeat:no-repeat;
    color:#054585;
    text-align:center;
    width:101px;
    height:27px;
    margin-left:10px;
    padding-top:5px;
    font-weight:bold;
    margin-bottom:-50px;
    z-index:1;

    }
    .ta
    {
    position:relative; 
    padding-right:15px; 
    }
    td{
        height:24px;
        font-family:"宋体"; 
    }
    </style></head>
    <body>
        <form id="myform" runat="server">
        <table id="Table1" border="0" cellpadding="0" cellspacing="0" style="margin-top:-15px; width:1005px; height:1100px; vertical-align:top;" runat="server">
        <tr>
        <td colspan="2" style="height: 330px" valign="top">
      <div id="head" style="position:relative; display:block; text-align:left; vertical-align:middle;">
        <img alt="" src="images/head.jpg" width="1005" height="280" /><br />
        <div id="navigation">
            <div style="width:500px; display:inline;">
            &nbsp;&nbsp;<span style="width:10%; text-align:center;"><a href="index.aspx" target="_top">首&nbsp;&nbsp;&nbsp;&nbsp;页</a></span>&nbsp;|&nbsp;<span style="width:10%; text-align:center;"><a href="companyDescription.aspx" target="_top">公司简介</a>&nbsp;|&nbsp;</span>
            <span style="width:10%; text-align:center;"><a href="quality.aspx" target="_top">资质荣誉</a></span>&nbsp;|&nbsp;<span style="width:10%; text-align:center;"><a href="productList.aspx" target="_top">产品展示</a></span>&nbsp;|&nbsp;<span style="width:10%; text-align:center;"><a href="projectCase.aspx" target="_top">工程案例</a>&nbsp;|&nbsp;</span>
            <span style="width:10%; text-align:center;"><a href="message.aspx" target="_top">留&nbsp;言&nbsp;板</a></span>&nbsp;|&nbsp;<span style="width:10%; text-align:center;"><a href="relation.aspx" target="_top">联系我们</a></span>&nbsp;|&nbsp;
            </div>
            <div style="display:inline; height:100%; float:right; right:0px; margin-right:10px; margin-top:-23px; width:auto;">
            <img alt="" src="images/relation.jpg" height="27" style="border:0px;" />
            </div>             
        </div>
      </div>
    </td>
    </tr>
    <tr>
    <td></td>
    <td>
    <div id="tab">
    <font face="宋体" size="+1">
    产品展示
    </font>
    </div>
    </td>
    </tr>
    <tr>
    <td style="width: 180px; height:800px; padding-top:-50px;" valign="top">
    <!-- body中的leftmenu部分 -->
    <div id="leftmenu">
    <div id="menu" style="padding-left:10px; margin-left:5px; margin-top:20px;">
    <table id="Table3" class="ta" width="90%" height="300"  runat="server" border="0" cellspacing="5" cellpadding="0" align="left">
        <tr>
          <td class="td" style="height: 28px">
          <img alt="leftbg" src="images/left.jpg" width="24" height="22" /><font face="宋体" color="#054585" size="3"><b>产&nbsp;品&nbsp;导&nbsp;航</b></font></td>
        </tr>
        <tr>
          <td class="td"><a class="a" href="product.aspx?proid=1" target="right">压焊钢格板</a></td>
        </tr>
        <tr>
          <td class="td"><a class="a" href="product.aspx?proid=2" target="right">踏步板</a></td>
        </tr>
        <tr>
          <td class="td"><a class="a" href="product.aspx?proid=3" target="right">复合板</a></td>
        </tr>
        <tr>
          <td class="td"><a class="a" href="product.aspx?proid=4" target="right">钢梯</a></td>
        </tr>
        <tr>
          <td class="td"><a class="a" href="product.aspx?proid=5" target="right">沟盖板</a></td>
        </tr>
        <tr>
          <td class="td" align="center"><a class="a" href="product.aspx?proid=6" target="right">插接钢格板</a></td>
        </tr>
       <tr>
          <td class="td" align="center"><a class="a" href="product.aspx?proid=7" target="right">围栏</a></td>
        </tr>
       <tr>
          <td class="td" align="center"><a class="a" href="product.aspx?proid=8" target="right">钢格板安装夹</a></td>
        </tr>
       <tr>
          <td class="td" align="center"><a class="a" href="product.aspx?proid=9" target="right">U形排水沟盖</a></td>
        </tr>   
      </table></div><br />
    <div id="connection" style="position:relative; display:block; margin-top:20px;">
    <a href="javascript:window.open('online/QQscript.aspx','','width=160,height=200');window.close();">
    <img alt="点击此图联系我们" src="images/left-connection.jpg" style="border:0px;" />
    </a>
    </div>
    </div>
    </td>
    <td style="padding-top:0px; text-align:left; vertical-align:top; height:1000px;  width:800; background-image:url('images/right_bg.jpg');
    background-repeat:no-repeat;">
    <!-- 可编辑主体区域 --><iframe id="right" name="right"
            style="width:650px; height:490px; margin-left:15px; margin-top:20px; margin-right: 131px; margin-bottom: 48px;" 
            scrolling="auto" frameborder="0" src="products1.aspx">
    </iframe>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <!-- 网站bottom部分 -->
    <div id="bottom" style="position:relative; display:block; padding-bottom:0px; bottom:0px; left:0px; height:100%">
    <img alt="底部声明" src="images/bottom.jpg" width="1000" style="padding-left:0px;" height="75" /><br/>
    <div id="advertising">
    <asp:Label ID="lblboot" runat="server" Text="<%=boot %>"></asp:Label>
    </div>
    </div>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
      

  3.   

    问题是我不知道哪里出了问题
    因为CSS样式都没变
      

  4.   

    发现问题!
    刚才我查看源文件 发现meta标签跑到了DOCTYPE上面,可meta标签是我后台动态生成的,要怎么改它的位置?
    <meta  Keyword ="主页,大连" Description ="我的个人主页"></meta >
     
    <!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 id="Head1"><meta http-equiv="Content-Type" content="text/html; Charset=gb2312" /><meta http-equiv="Content-Language" content="zh-CN" /><meta http-equiv="Refresh" content="300" /><title>
    我的...
    </title><
      

  5.   

    多谢各位的参与,我已经找到问题了,查看源代码发现的
    解决方法:<meta id="metainfo" runat="server" />
    后台直接调用metainfo再.就可以添加属性了