Code
  • 首页
  • cpu-architecture
  • performance
  • c++
  • branch-prediction
  • java
2024-12-14 10:00:07

使用:before和:after CSS选择器插入HTML

htmlcsscss-selectors

我想知道以下是否可以。我知道这行不通,但也许我写的语法不对。

li.first div.se_bizImg:before{
    content: "<h1>6 Businesses Found <span class="headingDetail">(view all)</span></h1>";
}

有办法吗?


content不支持HTML,只支持文本。你应该使用javascript, jQuery之类的。

代码的另一个问题是“在”块内。你应该混合'和' (class='headingDetail')。

如果内容确实支持HTML,您可能会陷入一个无限循环,内容被添加到内容中。

2011-05-03 06:42:39

推荐文章

  • 使伸缩项目正确浮动
  • 如何取消最大高度?
  • 形式内联内的形式水平在twitter bootstrap?
  • 自定义元素在HTML5中有效吗?
  • 如何选择在最后一个子元素之前的元素?
  • 如何触发自动填充在谷歌Chrome?
  • CSS变换,锯齿边缘在铬
  • 创建圈div比使用图像更容易的方法?
  • 强迫孩子服从父母的弯曲边界在CSS
  • 为什么Chrome浏览器不正确地确定页面是在不同的语言,并提供翻译?
  • 在CSS中@apply是什么?
  • 在网页上用鼠标模拟震颤(例如帕金森病)?
  • Bootstrap抛出Uncaught错误:Bootstrap的JavaScript需要jQuery
  • 如何改变文本区域的边框颜色:焦点
  • 我如何设置背景颜色为文本的宽度,而不是整个元素的宽度,使用CSS?

aliyun

最新文章

  • 如何删除默认的导航栏空间在SwiftUI导航视图
  • 我可以列出所有的标准Go包吗?
  • 证书验证失败:无法获得本地颁发者证书
  • 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
  • 打开同一目录两次
  • 实体框架核心:在上一个操作完成之前,在此上下文中开始的第二个操作
  • NullInjectorError: AngularFirestore没有提供程序
  • 如何为构造函数定制Visual Studio的私有字段生成快捷方式?
  • 从元组/数组值派生联合类型
  • 如何在Angular2中截断文本?
  • 安装tzdata非交互式
  • ionic 2 - Error在Android Studio中找不到Gradle的安装版本
  • 如何查看所有地区所有正在运行的Amazon EC2实例?
  • 当使用pip3安装包时,“Python中的ssl模块不可用”
  • 安装APK时出现错误

标签

cpu-architectureperformancec++branch-predictionjavaundogit-commitgitversion-controlgit-remotegit-pushgit-branchgit-pullgit-fetchpythongeneratoriteratorjsonmime-typescontent-typearraysjavascriptgit-addcode-formattingcstandards-complianceoperatorscommentsdynamic-memory-allocationstackmemory-managementheap-memorylanguage-agnosticoverwritebackground-colorbrowserhtmldomjqueryvisibilityuse-strictsyntaxjslintremote-branchgit-checkoutpython-moduleidiomsprogram-entry-pointnamespacesbranch
2025 code 京ICP备15047053号-1