Css 没有标题填满所有行

标签 css sass

我在 css/sass 中有一个标题类,如下所示:

  .title
    display: block
    float: left
    margin: 25px 10px 25px -20px
    padding: 11px 10px
    font-size: 22px
    font-weight: bold
    letter-spacing: 5px
    color: red
    background: #5279b5
    -webkit-border-radius: 11px
    -moz-border-radius: 11px
    border-radius: 18px
    border-top-left-radius: 0
    border-bottom-left-radius: 0

问题是,我添加了标题,但是例如,如果我添加了一个新表单,该表单就在标题旁边开始。我需要所有标题的行都是空的。

解决方案是使用 <br>在标题之后,但这不是我想要的。还有其他想法吗?

最佳答案

试试 clear: both; 或/和 margin-bottom: 10px;

关于Css 没有标题填满所有行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12157190/

相关文章:

html - Firefox 为@page 指令增加了 5mm 的额外边距

Angular-CLI 全局 scss 变量

css - SCSS(sass)计算: #{}

css - compass : Syntax error: Undefined mixin 'user-select'

jquery - IE 的 jquery datepicker 的样式问题(Ruby on Rails 3)

css - 使用 css3 渐变实现多种颜色

html - IE 忽略 flex 容器最小高度

html - Firefox/IE 中的 CSS 问题

sass - compass Sprite : applying individual styles to every sprite class without writing out each sprite name manually

css - 如何引用 SCSS 兄弟?