2017-03-26 129 views
0
here is the header Section code 

    #headerSection { 
      background-color: 2D487E; 
      color: white; 
      } 

邊界的背景色應該是深藍色了......左邊框和右邊框不顯示在瀏覽器

<section id="headerSection"> 
    <p class = "center"><img src= "images/nashcc.jpg" 
    class = "nashPic" 
    alt="Nash Community College" 
    title="Nash Community College" 
    width = "250px"/> 
    <span class = "title">Nash Community College</span><p> 
    </section> 
+1

你的代碼時,我將其粘貼到小提琴作品。所以這很可能是你的CSS被加載的問題,與其他一些風格的衝突等等。 – ryantdecker

+0

謝謝,你會看看。 –

+0

ryantdecker,我對jsfiddle.net一無所知,但我只是將紅色改爲#EEEEEE,並且根本沒有出現,就像在我的瀏覽器中一樣......只是想弄明白......可以你在jsfiddle中再次運行#EEEEEE ...真的很感激它。 –

回答

0

上headrSection這樣的背景顏色,你設置爲不工作,你在代碼之前需要一個#。還有一個小錯誤,你忘記了跨度後關閉p標籤。 https://jsfiddle.net/nundskat/(我只是改變邊境的顏色,使其更可見):

body{ 
 
    margin:0; 
 

 
    } 
 
    #headerSection { 
 
     background-color: #2D487E; 
 
     color: white; 
 
     
 
     } 
 
    .nashPic { 
 
     vertical-align: -275%; 
 
     padding: 0px; 
 
     border-right: solid 10px #EEEEEE; 
 
     border-left: solid 10px #EEEEEE; 
 
     }
<section id="headerSection"> 
 
<p class = "center"> 
 
    <img src= "https://www.nashcc.edu/images/site_images/[email protected]" class ="nashPic" alt="Nash Community College" title="Nash Community College" 
 
width = "250px"/> 
 
    <span class = "title">Nash Community College</span> 
 
</p> 
 
</section>