【问题标题】:Vertical rhythm and margin adjust in compass罗盘中的垂直节奏和边距调整
【发布时间】:2014-05-28 21:42:50
【问题描述】:

我试图理解为什么我需要增加像素值来减少边距。让我添加一些代码。

首先是基本的:

$base-font-size: 16px; 
$base-line-height: 24px;
@include establish-baseline; 

我想减少标签中的一些边距,为此我增加了像素值:

 h3 {
  font-weight:500;
  @include adjust-font-size-to(26px); 
  margin: rhythm(1, 56px) 0 0 0; /* 2 line above, 1 line below */
} 

为什么我需要增加 px 值?

【问题讨论】:

    标签: html css sass compass-sass


    【解决方案1】:

    好的,我觉得你的问题有点不清楚。

    首先,“增加像素值”是什么意思,哪个值?

    另外,它非常不完整,你是在使用一些重置或蓝图吗?

    $base-font-size: 16px; 
    $base-line-height: 24px;
    @include establish-baseline; 
    

    所以,有了这个,你就设置了你的基线,没关系。

    h3 {
     font-weight:500;
     @include adjust-font-size-to(26px); 
     margin: rhythm(1, 56px) 0 0 0; /* 2 line above, 1 line below */
    

    }

    但这部分不清楚。如果您只使用您编写的代码,则没有应用边距或填充,因此您的问题无效。

    您必须指定这些值的来源。另外我认为你应该看看参考:

    http://compass-style.org/reference/compass/typography/vertical_rhythm/

    另外,这会有所帮助:

    https://medium.com/typography/34fe2f1d2c02

    请更新答案并添加额外信息。

    【讨论】:

    • 实际上几周前我发现了我的错误,我想做的是改变一些 html 元素中的行高,比如列中的一些 h2 等。所以这个简单的代码工作正常:@include adjust -字体大小到(36px);行高:节奏(0.7);行高:节奏(0.7);
    • 好的,太好了。我认为您应该编辑您的答案或接受我的答案;-) 最好!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-12
    • 1970-01-01
    • 2013-10-08
    • 2011-08-16
    • 1970-01-01
    相关资源
    最近更新 更多