首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >一:在psuedo元素之前在四个h1之前..?

一:在psuedo元素之前在四个h1之前..?
EN

Stack Overflow用户
提问于 2014-11-26 06:25:25
回答 1查看 70关注 0票数 0

我这一生都不能让他的图标工作--我正试着在一个div中的一组h1标签前插入一个图标字体。我可以在每个H1标签之前获得一个图标字体,但这不是我想要的。要重新迭代,请在div之前使用一个图标字体,而不是每个h1。任何帮助都将不胜感激。仅供参考- H1中的文本由淡入和延迟组成,因此有独立的ID和标签。

代码语言:javascript
复制
.container{
  position:;
  margin:0px auto;
  background-color:pink;
  width:100%;
  height:100%;
  overflow: hidden;
}

.motto-text {
  position:absolute;
  display: ;
  bottom:;
  left:;
}

#hero-text .motto-text:before {
  font-family: icomoon;
  content: "\e600"; 
  display:block;
  height:25px;
  width:25px;
  padding-right:3px;
  text-align: center;
  font-size: 3em;
  float: left;
  position: relative;
  color: white;
}​
代码语言:javascript
复制
<div class="container">
  <div id="hero-text" class="motto-text"><!-- Hero text to start-->
    <h1 id="delayedText1" class="animated fadeIn delay-1">Line 1</h1>
    <h1 id="delayedText2" class="animated fadeIn delay-2">Line 2</h1>
    <h1 id="delayedText3" class="animated fadeIn delay-3">Line 3</h1>
    <h1 id="delayedText4" class="animated fadeIn delay-4">Line</h1>
  </div>
</div>

EN

回答 1

Stack Overflow用户

发布于 2014-11-26 06:33:26

您有一个错误的选择器:#hero-text .motto-text:before不匹配您的标记中的任何元素,因为它是一个子选择器。请改用#hero-text.motto-text:before或仅使用#hero-text:before

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27137933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档