border-left和border-right没有显示在浏览器中

时间:2017-03-26 18:49:02

标签: html

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 个答案:

答案 0 :(得分:0)

在headrSection上

你设置的背景颜色不起作用,你需要在该代码之前使用#。还有一个小错误,你忘了在跨度后关闭p标签。

&#13;
&#13;
    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;
        }
&#13;
<section id="headerSection">
 <p class = "center">
  <img src= "https://www.nashcc.edu/images/site_images/header-logo--full@2x.png" class ="nashPic" alt="Nash Community College" title="Nash Community College"
 width = "250px"/>
  <span class = "title">Nash Community College</span>
 </p>
</section>
&#13;
&#13;
&#13;