2015-02-06 60 views
0

我發佈了我的網站的工作版本到我的wwwroot文件夾,但是當我打開網站時,某些設計缺失。 我在chrome中查看了devTools(sources),發現我的css的某些部分缺失,當我從wwwroot文件夾打開css manualy時,我發現部件已經存在。 什麼可能會導致選擇性的CSS加載? 我的CSS文件的丟失部分:從wwwroot加載時缺少css部件

#layer { 
    background: url(http://s14.directupload.net/images/111129/44ga9qid.png); 
    height: 550px; 
    background-repeat: repeat; 
    position: absolute; 
    z-index: 3; 
    width: 100%; 
    top: 0; 
    left: 0; 
} 

#slide { 
    position: relative; 
    z-index: 1; 
} 

.menufixed { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 99999; 
    border-bottom: chocolate 8px solid; 
    background-color: rgb(0, 0, 0); 
    box-shadow: 0 0 10px black; 
} 

爲發佈到wwwroot文件夾整個css文件:

.menu_item { 
    color: #FFFFFF; 
    border-top: 4px solid #B6B5B5; 
    display: inline-block; 
    font-family: Arial; 
    font-variant: small-caps; 
    font-weight: normal; 
    padding: 5px 2px 0px 2px; 
    text-decoration: none; 
    /* font-weight: bold; */ 
    letter-spacing: 2px; 
    margin: 5px; 
} 

#Top { 
    border-bottom: chocolate 8px solid; 
    /* margin-bottom: 3%; */ 
    background-color: rgb(0, 0, 0); 
    box-shadow: 0 0 10px black; 
} 

a { 
    text-decoration: none; 
    color: #5E5E5E; 
} 

#Logo { 
    color: #5E5E5E; 
    font-family: 'Reenie Beanie', cursive; 
    display: inline-block; 
    margin-right: 3vw; 
    background: url(http://www.elinorart.com/Gallery/latest%20artworks/slides/93.jpg) no-repeat, #5E5E5E; 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
} 

h1 { 
    font-size: 70px; 
    margin: 5% 0; 
} 


h1:hover { 
    color: chocolate; 
} 

a:hover, a div:hover { 
    color: chocolate; 
} 

#menu_bar { 
    display: inline-block; 
} 

#contact_text { 
    width: 50%; 
    margin-left: auto; 
    margin-right: auto; 
    padding-bottom: 10px; 
    /* font-weight: 600; */ 
    font-size: 16px; 
    /* font-family: -webkit-pictograph; */ 
    color: #5E5E5E; 
    /* letter-spacing: 0px; */ 
} 

#bottom_left p { 
    padding: 0px 49px 0 64px; 
} 

#bottom_center p { 
    padding: 0px 62px 0 30px; 
} 

#contact_details { 
    padding-bottom: 10px; 
    color: #5E5E5E; 
    font-size: 16px; 
} 

#pageFooter { 
    font-size: 0.8em; 
    color: #5E5E5E; 
    text-align: center; 
    font-family: Arial; 
    margin-top: 10%; 
} 

li { 
    line-height: 24px; 
    font-family: Arial; 
    color: #1C1C1C; 
    font-size: 16px; 
    list-style-type: none; 
} 

.exhibit_name { 
    color: black; 
} 

#page { 
    text-align: center; 
    background-color: rgb(232, 232, 232); 
} 

.page_content { 
    font-family: Arial; 
    /*text-align: initial;*/ 
    /* background-color: rgb(232, 232, 232); */ 
    /* padding-top: 3%; */ 
} 

p { 
    font-size: 16px; 
    font-family: Arial; 
} 

@media screen and (max-width: 768px) { 
    body { 
     background-color: lightblue; 
    } 
} 

body.about_me { 
    background-color: green; 
} 

.borderClass { 
    border-color: chocolate; 
} 

#contactDiv { 
    display: inline-block; 
} 

td { 
    vertical-align: top; 
} 

.contact_field { 
    border-bottom-width: 1px; 
    border: 1px solid #5E5E5E; 
    border-radius: 4px; 
    font-size: 16px; 
    font-family: Arial, cursive; 
    width: 322px; 
    height: 24px; 
} 

.contact_field_desc { 
    font-size: 14px; 
    padding: 4px; 
    font-family: Arial; 
    text-align: left; 
} 

.send_form { 
    border-bottom-width: 1px; 
    border: 1px solid #5E5E5E; 
    border-radius: 4px; 
    padding: 5px 28px; 
} 

body { 
    margin: auto; 
} 

#Facebook { 
    /* width: 100%; */ 
    /* text-align: center; */ 
    /* margin-left: 40%; */ 
    /* margin-top: 3%; */ 
    display: inline-flex; 
    margin-top: 2%; 
} 

#fb-root { 
    /*float: left;*/ 
    vertical-align: central; 
    margin-right: 10px; 
} 

#fb-root2 { 
    /*float: right;*/ 
    vertical-align: central; 
    margin-left: 10px; 
} 

.fb_iframe_widget { 
    /* margin-right: 13px; */ 
    /* float: left; */ 
    padding-right: 10%; 
} 

.exhibitions { 
    width: 40%; 
    margin: 0 5%; 
    float: left; 
    /*text-align: left;*/ 
} 

.wrapper { 
    display: inline-block; 
    width: 45%; 
    text-align: left; 
} 

.exhibitions_wrapper { 
    padding-right: 3%; 
} 

ul { 
    padding: 0px; 
} 

    ul li ul li { 
     list-style-type: initial; 
     padding-bottom: 10px; 
    } 

.exhibitions_year { 
    /* margin-left: -5%; */ 
    font-family: 'Reenie Beanie', cursive; 
    font-size: 37px; 
    /* line-height: 1px; */ 
    margin: 14px 0; 
    color: orange; 
    color: chocolate; 
    font-weight: 500; 
    letter-spacing: 4px; 
} 

.bottom_sections { 
    width: 25%; 
    /* height: 100%; */ 
    vertical-align: top; 
    text-align: left; 
    display: inline-block; 
    /* padding: 2%; */ 
} 

.bottom_content { 
    /* padding: 0 10%; */ 
    text-align: center; 
} 

.buttom_text { 
    font-size: 13px; 
    line-height: 25px; 
    padding: 0 10%; 
    text-align: left; 
} 

#AboutMe p { 
    font-size: 13px; 
    line-height: 25px; 
} 

.contact_info { 
    display: inline-block; 
    width: 19%; 
    vertical-align: top; 
    padding-left: 30px; 
} 

#exhibitions_wrapper { 
    width: 70%; 
} 

#AboutMe .wrapper { 
    border-right: 1px solid lightgray; 
    padding-right: 30px; 
} 

h3 { 
    padding-top: 3%; 
    margin: 12px 0; 
    font-variant: small-caps; 
    font-size: 37px; 
    font-weight: normal; 
    color: dimgrey; 
    letter-spacing: 10px; 
    font-family: Arial; 
} 

h4 { 
    font-size: 24px; 
    color: dimgrey; 
    font-variant: small-caps; 
    font-weight: normal; 
} 

h5 { 
    margin-top: 30px; 
    /* padding: 15px; */ 
    border-bottom: 1px solid black; 
    font-size: 24px; 
    color: dimgrey; 
    font-variant: small-caps; 
    font-weight: normal; 
    text-align: center; 
} 

h2 { 
    /* padding: 0; */ 
    margin-top: 12px; 
    font-variant: small-caps; 
    font-size: 32px; 
    font-weight: normal; 
    color: dimgrey; 
    letter-spacing: 10px; 
    font-family: Arial; 
} 

#AboutMe .contact_field { 
    width: 187px; 
} 

input { 
    margin-bottom: 15px; 
} 

.gallery_homepage { 
    height: 550px; 
    position: absolute; 
    z-index: 2; 
    top: 0; 
    left: 0; 
} 

.gallery_homepage div { 
    height: 550px; 
} 

#layer { 
    background: url(http://s14.directupload.net/images/111129/44ga9qid.png); 
    height: 550px; 
    background-repeat: repeat; 
    position: absolute; 
    z-index: 3; 
    width: 100%; 
    top: 0; 
    left: 0; 
} 

#slide { 
    position: relative; 
    z-index: 1; 
} 

.menufixed { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 99999; 
    border-bottom: chocolate 8px solid; 
    background-color: rgb(0, 0, 0); 
    box-shadow: 0 0 10px black; 
} 

謝謝!

+0

部分的.css文件?或者一些.css文件被加載,而其他的不是? – mezod 2015-02-06 12:33:12

+0

您在控制檯窗口(在瀏覽器開發工具中)中是否收到任何錯誤? – 2015-02-06 12:37:32

+0

@mezod - 只有一個css文件,缺少的部分是上面的。 – Ira 2015-02-06 13:17:05

回答

0

可能有很多原因吧:

  1. 你的CSS規則可能通過內聯樣式覆蓋
  2. 它可以通過其他前規則在同一個CSS文件
  3. 覆蓋(在後面的行)
  4. 您可能會忽略使用'!important'的css(這可以在開發工具中看到)
  5. 您的CSS文件中可能有錯誤,例如語法錯誤或缺少';'規則或丟失「{」或「}」在規則的開頭或結尾塊
  6. 最後但並非最不重要的,你可能沒有被正確包括(正確)的CSS文件中的HTML

希望在此之後幫助。

+0

嗯,我檢查了需要受到缺少CSS樣式影響的元素(使用inspect元素),並且沒有適用於它們的樣式,也沒有覆蓋(如果它們會出現在devTools中)。我只有一個css文件,當在devTools中查看它的內容時 - 大部分出現 - 只有上面發佈的css部分從該文件中丟失。 – Ira 2015-02-06 12:41:27

+0

您是否檢查了語法錯誤,如缺少{或}或; ?? – 2015-02-06 12:42:27

+0

是的,檢查它,一切看起來很好 - 缺少的部分是上面公佈的部分。也嘗試將其移動到css文件的其他區域,並且這個確切的部分每次都會丟失。 – Ira 2015-02-06 12:45:07