css - 如何仅使用 CSS 突出显示文本中的一个特定单词?
问题描述
如何仅使用 CSS 突出显示文本中的一个特定单词?我不能在标签 p 中添加另一个标签。
<p class="header_heading">
Some text that I need to highlight
</p>
解决方案
在单词周围放置一个跨度并应用于background-color
跨度。
<p>
Some text <span style="background-color: green;">that</span> I need to highlight
</p>
推荐阅读
- reactjs - 如何在 react-chartjs-2 中操作数据
- python - 来自 Panda Dataframe 而不是 Sample Data 的 K 聚类
- java - 使用 Java 以 CSV 格式写入数据
- prolog - 在 Prolog 列表中反转到中间
- python - 如何识别包含浮点数和整数的熊猫数据框中的整数
- bash - BSD 中的进程替换挂起(有时)
- ios - AVSpeechSynthesisVoice 不适用于某些用户
- python - Python Pandas 将不匹配的时间序列处理并合并为数据框
- spring-boot - Spring Boot 中 LogBack 的哪种日志记录模式使用换行符缩进消息?
- python - 命令组合 .txt 文件中的所有单词