2012-11-03 92 views
-1

可能重複:
Homepage loads differently than every other page主頁是其他任何網頁不同的網站上

爲什麼我的網頁有1024像素的寬度。之後的每一頁都有1280像素的寬度?即使是全屏,這也是它的加載方式。爲什麼?

規格:瀏覽器:Chrome瀏覽器位於本地機器上的頁面。

root { 
    display: block; 
} 
#leftcol a{text-decoration: none;} 
#leftcol{ 
    left: 10%; 
    width: 200px; 
    height: 100%; 
    margin-top: 0px; 
    position: absolute; 
    opacity:0.6; 
    color: white; 
    font-size: 2em; 
} 
#left-placeholder{ 
    height: 100%; 
    width: 10%; 
    float: left; 
} 
#left-pusher{ 
    height: 100%; 
    width: 200px; 
    float: left; 
} 
.left-column-item{ 
    background: url('images/bgnav.jpg'); 
    height: 33.334%; 
    background-size: 100%; 
    opacity:0.6; 
    color: white; 
} 
.left-column-item:hover{ 
    background: url('images/bgnav.jpg'); 
    height: 33.334%; 
    background-size: 100%; 
    opacity: 1; 
} 
#content{ 
    text-align: center; 
    color: white; 
    font-size: 5em; 
    height: 100%; 
    width: 70%; 
    float:left; 
} 

body{ 
    background: url('images/background.jpg'); 
    background-size: 100%; 
    margin: 0; 
    min-height: 100%; 
    width: 100%} 
html, body 
{ 
    height: 100%; 
} 
//html for homepage: 

<html> 
    <head> 
     <title></title> 
     <LINK href="styles.css" rel="stylesheet" type="text/css"> 
     <script type ="text/javascript"> 

     </script> 
    </head> 
    <body> 
      <div id ="leftcol"> 
       <a href="content/practice.html"><div class ="left-column-item">Practice!</div></a> 
       <a href="content/AboutUs.html"><div class ="left-column-item">About Us!</div></a> 
       <a href="content/contactUs.html"><div class ="left-column-item">Contact Us!</div></a> 
      </div> 
     <div id="left-placeholder"></div> 
     <div id ="left-pusher"></div> 
     <div id ="content">Math Practice Site<br>Welcome</div> 
    </body> 
</html> 
// the practice page that is not loading correctly 

    <!DOCTYPE html> 
    <html> 
     <head> 
      <title></title> 
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
      <LINK href="../styles.css" rel="stylesheet" type="text/css"> 
      <script type ="text/javascript"> 

      </script> 
     </head> 
     <body> 
       <div id ="leftcol"> 
        <a href="practice.html"><div class ="left-column-item">Practice!</div></a> 
        <a href="aboutUs.html"><div class ="left-column-item">About Us!</div></a> 
        <a href="contactUs.html"><div class ="left-column-item">Contact Us!</div></a> 
       </div> 
      <div id="left-placeholder"></div> 
      <div id ="left-pusher"></div> 
      <div id ="content">Math Practice Site <br> hello</div> 
     </body> 
    </html> 
+0

...你能顯示主頁的鏈接..? –

+0

不要雙重張貼:http://stackoverflow.com/questions/13211562/homepage-loads-differently-than-every-other-page –

+0

爲什麼根{display:block;}?爲什麼不是HTML {display:block;}? – Jawad

回答

2

這很難理解你的問題。 無論如何,嘗試添加強制性「;」在你的CSS文件的「body」定義之後的「width:100%」之後(在「}」之前)

0

快速瀏覽讓我覺得唯一真正的區別是對css頁面的引用。該頁面的其餘部分是否已經應用了適當的CSS,還是CSS作爲整體關閉?

如果是後者,請嘗試用完整路徑替換../

相關問題