html - 如何在 HTML 和 CSS 中获取带有虚线的特定单词?

标签 html css

我有以下文字:

  1. 我早上吃了酸奶

  2. 酸奶很好喝

  3. 早上喝酸奶有益健康

我想用虚线在“酸奶”一词下划线。

<u> 下划线很容易标签,但我很困惑如何让特定的单词用点加下划线。

最佳答案

一种方法是使用带点的 border .

演示:http://jsfiddle.net/HhRT5/

<ol>
    <li>I ate <span class="yogurt">yogurt</span> in the morning</li>
    <li><span class="yogurt">yogurt</span> was very nice</li>
    <li>eating <span class="yogurt">yogurt</span> in the morning is healthy</li>
</ol>

.yogurt {
    border-bottom: 1px dotted #aaa;
}

关于html - 如何在 HTML 和 CSS 中获取带有虚线的特定单词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15846908/

相关文章:

html - 页面周围出现异常 "border"

jquery - 需要一个非常简单的工作文件 uploader

html - 页脚 div 定位到错误的位置

javascript - 如何翻转 Div 的内容

javascript - 如何两次导入less文件以启用主题切换

html - 使用 css table 将两个 div 并排放置

html - 在不同的按钮上打开不同的下拉内容

html - 在图像上方添加文本

html - Opera 中的边框半径和边框宽度

javascript - 导航栏动画