html - 向自定义标题 css 样式添加换行符?

标签 html css

新手问:如何在自定义标题样式中添加换行符?

h21 
{
    font-size: 1.52em;
    /*Equivalent of a line break here...????*/
}

最佳答案

您不能在类声明中添加换行符,但可以添加 margin-bottom 或 padding-bottom: -10px 或类似的变体。您可以使用 firebug 来测量页面上换行符的高度,并将该值用于 padding 或 margin-bottom。

h21 {
    font-size:12.1px;
    padding-bottom: 30px;
    display: block;
}

关于html - 向自定义标题 css 样式添加换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7588145/

相关文章:

jquery - 图片网址 : data:image/png;base64 (KineticJS)

html - CSS Treeview(嵌套列表),显示为表格

html - 所有 img 都应该是 100% 的基本 Bootstrap 设置吗?

css - 为什么这个 CSS 下拉菜单在 IE9 中消失了

javascript - 如何切换 div 列表中的背景颜色?

javascript - 调整固定导航菜单的大小

javascript - NVDA 不读取带有 aria-label 的 aria-desiredby

javascript - 如何在 HTML Canvas 中将正方形转换为梯形?

javascript - Dragendjs 在 jquery-mobile slider 上停止滑动

javascript - 如何在打印时对齐文本