当我为span元素设置样式时,图标不会出现

时间:2014-08-12 15:39:25

标签: html css

我正在尝试插入一个&符号,但它似乎不会出现在我的HTML中。

我的HTML代码是:

  <section style= "background: #FEFEFE;" id="intro">
  <b>" We are a digital marketing shop that creates marketing solutions" <br>
  <br>


   As designers, programmers <span> & </span> problem solvers, we love all things                          

  </b>
  </section>

CSS:

 #intro {
     height: auto;
     padding: 50px 0;
     background: #fff;
     text-align: center;
     color: #52626e;
     font-size: 30px;
     font-weight: normal;
 }
 #intro span {
     background: url(../images/icons.png) no-repeat -0px -13px;
     padding: 0 12px;
     text-indent: -9999em;
     display: inline-block;
     *display:inline;
 }

1 个答案:

答案 0 :(得分:2)

#intro {
  height: auto;
  padding: 50px 0;
  background: #fff;
  text-align: center;
  color: #52626e;
  font-size: 30px;
  line-height: 36px;
  font-weight: normal;
}
#intro span {
  background: url(http://www.makeyourowngarments.com/sites/default/files/our_images/&%20sign.png) no-repeat;
  background-size: 36px;
  width: 36px;
  text-indent: -9999em;
  display: inline-block;
}

查看jsfiddle

上的快速而肮脏的示例