上传到服务器时CSS样式无法正常工作?

时间:2016-08-23 21:25:19

标签: css styling

我已经创建了一个基本页面,从我为其余网站创建的模板中创建了一个基本页面,但是将其中的大部分内容分开以使页面看起来“未设计”。它只有一个无序列表,其中一个短段固定在顶部,一个徽标浮动右侧。它适用于系统预览,但是当上传到服务器时,它会丢失所有的CSS样式。

这是html:

#title {
    width:400px;
    position:fixed;
}

#icon {
    position:relative;
    float:right;
}

h5 {
    font-size:25px;
    color:#ff6682;
    line-height:1.35em;
}

a:link {
    color:#253b84;
}
<!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>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>/other</title>
      <link href="assets/scripts/AMK_Website.css" rel="stylesheet"              
         type="text/css" />
   </head>
   <body>
      <div id="icon">
         <img src="assets/images/icon/icon.gif" width="80" height="106" alt=""/>
      </div>
      <div id="title">
         <h5> /other is a collection of personal work in design photography, as    
            well as work that inspires me. To get back to
            the important stuff, <a href="index.html">click here</a>
         </h5>
      </div>
      <div id="photolist">
         <ul>
            <li><img src="assets/images/other/1.jpg" width="768" height="1024"        
               alt=""/></li>
         </ul>
      </div>
   </body>
</html>

帮助表示赞赏!

1 个答案:

答案 0 :(得分:0)

听起来你的css不是html链接所期望的。如果您指向assets/中的文件,请确保该文件夹与您的html文件位于同一目录中,并确保它包含该特定的css文件。